virt: propcan clean some old style construction.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: propcan change __slots__ listing to avoid waste a memory.

class X:
   __slots__ = ['a', 'b']

class Y(X):
   __slots__ = X.__slots__ + ['c']

Double declaring of slots causes a waste of memory
and aims to bad manners to slots.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Replace class method with class attribute

There are very few places that need to re-calculate all ancestor
__slots__ values. It's more efficient to just store them as
an instance attribute, set from __new__().  I also updated
all users dependent on the old __slots__ behavior to use
the new __all_slots__ attribute instead.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Make special methods in propcan special

Burried in docstrings are instructions that using propcan's
special dict_set, super_set, etc. methods is for subclasses only
(i.e. not for test-modules!)  One test was doing this, so I assume
the convension is/could/would be lost on other people also.  Renamed
these special methods with double-underscore names to flag them as
being special.  Updated documentation (in case it gets read) also,
but I'm assuming the new names will serve as a better deterance
to using them.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: virsh_cpu_compare test shouldn't use special methods

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: nodev-xml unittest bugfixes

The unittests were mistakenly relying on the host system's
virsh/libvird state.  Mocked up the used dumpxml method
to make the unittest self-contained.  There was also a bug
in passing the dummy virsh instance in as a positional instead
of named parameter.  API changes were made but unittests never
updated.  They're all passing now.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fix vm_xml to use new propcan methods

The propcan dict_get, dict_set, dict_del were renamed
with double-underscores in a prior commit, but updating
this module was missed.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Propcan additional fixes

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt-libvirt: libvirt_xml new_from_dumpxml fixes

Signed-off-by: Chris Evich <cevich@redhat.com>
general: PEP8 fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Move utils_koji to staging

This is yet another library that we want to move to
autotest proper, since it is in fact already there.
So it needs to be in virttest.staging rather than virttest.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.staging.utils_koji: Retry file downloads

In order to make the code a little more robust, so
we can achieve better success rates in flaky networking
infrastructures, if we had a failure downloading a file
from Brew or Koji, retry during a timeout (30 seconds),
in fixed time intervals (3 seconds). If at the end of
this timeout we still didn't get it, give up and throw
an error.

As the code uses frequently the terminology 'get' for
this rather than 'download', I opted for an internal
method _get() that encapsulates all the process nicely.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
general: More docstring fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>