yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #13434
[Bug 1305186] [NEW] Fake libvirtError incompatibile with real libvirtError
Public bug reported:
PROBLEM
The existing `fakelibvirt.libvirtError` is actually not compatible with
the real `libvirt.libvirtError` class in that it accepts different
kwargs in the `__init__`.
This is a problem because test code may use either class depending on
whether `libvirt-python` happens to be installed on the box.
For example, if `libvirt-python` is installed on the box and you try to
use `libvirtError` class from a test with the `error_code` kwarg, you'll
get this exception: http://paste.openstack.org/show/75432/
This code would work on a machine that doesn't have `libvirt-python`
installed b/c `fakelibvirt.libvirtError` was used.
POSSIBLE SOLUTION
Copy over the real `libvirt.libvirtError` class so that it matches
exactly.
Create a `make_libvirtError` convenience function so we can still create
`libvirtErrors` using the nice `error_code` kwarg in the constructor
(b/c 99% of the time that's what we want).
** Affects: neutron
Importance: Undecided
Assignee: Rick Harris (rconradharris)
Status: In Progress
** Changed in: neutron
Assignee: (unassigned) => Rick Harris (rconradharris)
** Changed in: neutron
Status: New => In Progress
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1305186
Title:
Fake libvirtError incompatibile with real libvirtError
Status in OpenStack Neutron (virtual network service):
In Progress
Bug description:
PROBLEM
The existing `fakelibvirt.libvirtError` is actually not compatible
with the real `libvirt.libvirtError` class in that it accepts
different kwargs in the `__init__`.
This is a problem because test code may use either class depending on
whether `libvirt-python` happens to be installed on the box.
For example, if `libvirt-python` is installed on the box and you try
to use `libvirtError` class from a test with the `error_code` kwarg,
you'll get this exception: http://paste.openstack.org/show/75432/
This code would work on a machine that doesn't have `libvirt-python`
installed b/c `fakelibvirt.libvirtError` was used.
POSSIBLE SOLUTION
Copy over the real `libvirt.libvirtError` class so that it matches
exactly.
Create a `make_libvirtError` convenience function so we can still
create `libvirtErrors` using the nice `error_code` kwarg in the
constructor (b/c 99% of the time that's what we want).
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1305186/+subscriptions
Follow ups
References