Using of locals() for formatting string is a nasty thing because:
1) It is not so clear as using explicit dicts
2) It could produce hidden errors during refactoring
3) Changing name of variable causes change in message
4) Creating a lot of unused variables
fixes bug 1171936
Change-Id: I293d7ebb875f65cce322d4938d1ae323f3aded8d
Remove a bunch of local custom scripts. Replace with configurable
external tools.
Use local hacking checks for nova specifics.
Change-Id: I75a01375ba0ec36d2ff05abc47abe0a3f225eda5
`_get_and_check_image_metadata` pulls `size` from the image, which
comes in as string, but fails to convert it to an integer before
comparing with the flavor's `root_gb` size. This patch adds the cast
along with some test coverage for this method.
Fixes bug 1180159
Change-Id: I92bc9d6a808e49173d806e434cb145c751c8314a
Tests that define both Mox and Stubs may not receive a proper cleanup by the
`TestCase` base class. The reason is that the order in which the Mox and Stubs
are unset may not necessarily match-up with the order in which the tests
called them. For example:
Suppose we have a test that Stubs a method in its `setUp` and then Mox's that
same method in the test body:
Stub: Original-Func -> Stubbed-Func
Mox: Stubbed-Func -> Mocked-Func
Now when `TestCase` ultimately does its `cleanUp`, it will UnStub before
UnMocking:
UnStub: Stubbed-Func -> Original-Func
UnMox: Mocked-Func -> Stubbed-Func
Notice that generic cleanup has mistakingly left `Stubbed-Func` in place.
Given that Stubs and Mox can be performed in any order, the upshot here is
that the generic cleanup can't always be relied on.
The proposed solution has two parts: a best-practice change and a small
code-change.
The code-change is to reverse the current order to UnMox before UnStubbing.
While in theory the order is arbitrary, in practice, we have lots of Stubs in
`setUp` methods already, so UnMox'ing first makes sense (and it fixes a
current bug to boot!)
The best-practice change is to recommend against stubbing and mocking the same
function as well as to always place stubs before mocks when relying on the
generic cleanup. If a developers needs to deviate from this, cleanup of stubs
created after mocks are their responsibility.
Fixes bug 1180671
Change-Id: I42ab8b55026c0a133625a7cc81ed8b960e9d47d7
When using assertEqual, the expected result should actually be the first
argument so any failures have 'expected' and 'actual' values printed
properly.
Change-Id: I34d16f298eb0bf62e2abaaf31e80911fa124dc24
When using Quantum for networking and setting flat_injected to
inject network settings into the guest VM, Nova injects a static
network configuration for networks using DHCP. This change
checks for the existence of a dhcp server and, if found, does not
inject static settings for that network.
Due to limitations of the legacy network info, the fix only
applies when new-style network info is passed to the injection
template function. The only code still passing in legacy
network info is in libvirt, and there is work ongoing to
remove that dependency.
Fixes bug 1163985
Fixes bug 1112659
Change-Id: I8d3f16bde22e1c6dc0d2432aa263e2b15ae5c93a
Allow for ca certificates file to be specified when doing cinder
client requests. Needed when using custom ca authorities.
Change-Id: Ib9aa15df2fc7d96cb8587c13769399e353c032c6
Fixes: bug #1179476
This reverts commit dd66f235ec.
This changed the core servers API without doing it as an API extension,
so it's not an acceptable change as written.
Change-Id: I3787060583de1371e366647d38d69f37746317d5
Sync some trivial Python 3 compatibility and pep8 improvements from oslo.
I just want to have this in sync so that pulling in a feature I'm working
on comes in without unrelated changes
Change-Id: I13fcb0bd538a153b90acf0b18497e335a64dc9d1
Due to formatting changes in the multipath -l output
we were sometimes missing the device name for each of the
multipath devices which gave us a device of '/dev/'. This
causes problems on detach.
Fixes Bug: #1180497
Change-Id: I6017dda149776624fac452140d3d0f5df3f5fd5a
Added new tests for fixed_ip*() functions.
Function fixed_ip_create() should return FixedIp instance rather than
FixedIp.address, because it is used in a tests later.
Fix calls of fixed_ip_create() respectively.
blueprint test-db-api
Change-Id: Id5e9d4486605bde9d9fd1e631d868603a7a7c604
Fix for bug 1155066
This change adds some rollback into the resize disk down
code within xenapi, and reports a better error message
when the disk is too big to resize down.
On a successful rollback, the user is notified of the error
by the instance actions, rather than leaving
the server in the error state.
The user is then able to free up some disk space such that
the resize can work correctly.
Change-Id: Ibad568ab3cfb9caaf4fe002572c8cda973d501a7
Adds support for passing 'expected_vm_state' in an instance_update dict
much like the current support for 'expected_task_state'.
For cells, when the API cell receives an instance update containing a
vm_state of BUILDING, raise an exception if the instance is in some
other state. This addresses out-of-order messaging issues that can
cause an instance to appear to have a huge delay going ACTIVE. (A
periodic task run can later heal the state, but it can take a long
while)
Fixes bug 1180283
Change-Id: I64252b30e2596812f3b84da64b1fc8681661d7f8