The os-floating-ips extension was catching and handling a 404
and 403 in the same block and raising HTTPNotFound for both.
This change separates the 404 and 403 cases so HTTPForbidden
is returned in the 403 case. For the 404 case, the test is
updated to raise the proper NovaException and a new test is
added for the 403 Forbidden case.
Change-Id: Id0daf2d61c6960d845d3b7980f96228fece41128
The case with the tag "moduleauthor" is not handled when
checking to avoid author makers.
Also fix the position when the tag Author is used.
Change-Id: I17b07b9f5448f9cbb4c5705f655c5392316a6239
Closes-Bug: #1314176
There is no assert_not_called() method in mock, as described here:
https://code.google.com/p/mock/issues/detail?id=159
Fix these calls to use the mock.called attribute instead.
Closes-Bug: #1316167
Change-Id: I865463244ebfc45e1f940c74e1afbb9084930bb3
A couple of unit tests were importing twice mock or mox.
This patch just remove the duplicated import.
Change-Id: I0c66746348e184a3846cadd40d7d7cbb7d594564
To better understand why sync_power_state is being skipped include the
pending task name in the log message.
Change-Id: I832a3d5820efab301e12610b28ca2a1e5cfd946a
`os.O_DIRECT` is only defined on platforms that support direct I/O. On
Macs, which don't support direct I/O in this way, `os.O_DIRECT` will
raise an `AttributeError`.
We can still test the code-path, however, by just stubbing out the
value on platforms where it's not supported.
Closes-Bug: 1286958
Change-Id: I8f10d6dfc4a63b6a961006b029b828e703870e46
This makes add_instance_fault_from_exc() use the InstanceFault
object instead of a raw conductor call. This is actually a
minor change except that all callers of this method must now
stop passing the conductor API, and tests must return something
valid from the mocked call.
Related to blueprint virt-objects-juno
Change-Id: I49b17c1ef3d14fd36f016c37d88287e62126bf68
This allows creating InstanceFaults through the object interface.
Related to blueprint virt-objects-juno
Change-Id: Iedde2e220127778fa6252d310f9e73c8506f605e
This removes use of some service calls in the conductor by xenapi's
host.py module and replaces them with object usage. Existing tests
are sufficient to confirm the same behavior remains.
Related to blueprint virt-objects-juno
Change-Id: I908cca4fa1d297c5c9b1d84ae7ebe7452a30ba12
This patch optimizes validate_networks so that it only queries neutron
when needed. Previously, this method would perform an additional net_list,
list_ports, and show_quota regardless if a request contains only
port_ids. If a request only contains port ids we do not need to check neutron
for quota as these ports are already allocated.
Change-Id: Ia7abc7d95b663f165fc95385dda3bab13b7a43e6
Closes-bug: #1291565
Moves the inner function "execute_create_vm" from the spawn method
to vm_util. Additionally, return the vm_ref after VM creation so
an extra call to retrieve the vm_ref does not need to take place
after the fact.
partial blueprint vmware-spawn-refactor
Co-authored-by: Tracy Jones <tjones@vmware.com>
Change-Id: I67c3c8c14b6c01b160611cc001d51f1da29ffb24
The root cause of the slow agent tests was not mocking this method:
compute_utils.add_instance_fault_from_exc
This cleans up the tests to share a bit more code, and ensures they
actually check that the appropriate exception is raised.
This change adds a log message to report errors that could occur in
running systems that also helped identify this issue in the unit tests.
test_spawn_fails_agent_not_implemented was a duplicate test and has been
removed.
Change-Id: I6fd31520fffd5e888ce0c2b58af2715f0d929ce1
Closes-Bug: #1279317