Adds support and tests for the os-agents extension
for the Nova V3 API
Partially implements blueprint v3-api
Change-Id: I53f8a1cbab6f4dee10fb823bc51ae90baa97fa7a
The first part of adding flavor support for the Nova V3 API (support
for flavor-access API calls is still to come).
Restructures v1_1 testcases so as much as possible so they can be
reused for the V3 version of the tests. If it looks too ugly an
alternative would be to just cut and paste the fakes and test
from v1_1 to v3, which is simpler to understand but comes at the
cost of duplicated code. The upside though is it would be much
easier to remove v1_1/v2 support in the future.
Partially implements blueprint v3-api
Change-Id: Ic7cb3c43db02c07d37aea2675b310aaa50639c40
Set the default service type when talking to the Nova V3 API to
computev3 rather than compute. Although it is rather ugly to have
a different service type for a different version of a service,
this is necessary for the medium term because traditionally the
compute service endpoint has pointed to the V2 API rather than
the root and then version discovery done.
This change allows progression of the V3 API support in
novaclient and although devstack too currently points computev3
directly to the V3 API, the intent is to change this to point to
the root and implement version discovery during the Icehouse
development cycle.
Longer term when the V2 API support is eventually removed we can
reclaim the 'compute' service type and point it to the root.
Partially implements blueprint v3-api
Change-Id: If5d6a0d8af037cde7bf253d71aac2823b89f8066
Prints info about the new image when --show is used with the
image-create subcommand.
Change-Id: Id1fba67df9ff86cb1bbda3e241d1d03e01afbe2c
Closes-Bug: 1248128
This patch allows users to retrieve VM encrypted passwords using the
`nova get-password` command without specifying the private key.
Change-Id: I13ea132160dca912c6c1643b1006377982b778a1
Implements: blueprint retrieve-ciphered-vm-password
If we installed neutron, the security-group request will be handled
by neutron, however neutron is using uuid as key for security-group,
nova uses an int value as key, for current novaclient, it only
support the security-group which key is int, so will raise exception
for uuid input.
Change-Id: Ia230d12a1b4905434024b1a5129aa91cff7e6a5b
Closes-Bug: #1247728
Jenkins patch I96b53ce825ca0f940596f53058b8e3c80463ac3c introduces
hacking 0.8, this fix the one bug.
Change-Id: Ib4ee60b4de32c59cb3552091f0ce50f366fe0879
Flatten the nested dicts so that hypervisor information can be more
easily used at the command line.
Change-Id: I5dfcf9d10f917a63bde09f0b5a691784a5e8f02b
Closes-bug: #1243512
'nova aggregate-details' shows Hosts, Availability Zone
and Metadata in the python unicode notation.
Change-Id: If0028347146439994265c60c429af05dd67912f9
Closes-Bug: #1132961
This patch didn't do what it was supposed to do, make os_cache work. Instead it just adds complexity, so just remove it.
This reverts commit 8eed73ce20ff0808d350fc9af66d6ba55ebda017.
Change-Id: I7c118cbf8d8e2218e198d603f1984a9de18266c4
Mock sys.stderr/sys.stdout with mock.patch()
In novaclient/tests/test_shell.py, ShellTest.shell(), it is another
case that should be aligned. But it may induce test error if changed.
So, let's keep it as is.
Close-Bug #1237093
Change-Id: I8908dc1593dbbbaf2813cc8fb034be32972140a0
six.StringIO() is the right way to keep Python2/3 compatibiliby
while mocking stdout/stderr.
Close-Bug #1235086
Change-Id: I33d9223b2202896331d24339056d57d4ca9acdc5
In novaclient.client.HTTPClient.request, json.dumps() process the
body of "POST":
kwargs['data'] = json.dumps(kwargs['body'])
So, in test case, we should pass the same forat for mock.call().
Also, transform the "data" variable to json format.
Close-Bug #1234067
Change-Id: I3a0abaa8064b4360cb94b7b205454e26bddef8e4
In Python 3.3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ across
Python runs.
In the test case, the fixed expecting string will not match the test
result, it is relying on the dict order.
This change transforms the input dict to a sequence of two-element list,
with fixed order, and update the related expecitng string in test case.
Close-Bug #1234438
Change-Id: Ic7846279a9f508a856cd4ee70408d537088792f2
In Python 3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ across
Python runs.
Sort the list and update the expecting result.
Close-Bug #1233406
Change-Id: Ib747824dad340534d484797afb87b5e92200e426
Binary I/O expects and produces bytes objects. If sys.stdout is
assigned to io.BytesIO, print() output it stdout by default, then
there will be "TypeError".
For this case, mock.patch() decorator can not work well casually.
So this patch just update the six.StringIO() for stdout/stderr.
Close-Bug #1229163
Change-Id: Ieb29ad0774c9b7f2b691628d753b210640baca8d
In Python 3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ across
Python runs.
In the test case, the fixed expecting string will not match the test
result, it is relying on the dict order.
This change transforms the input dict to a sequence of two-element list,
with fixed order, and update the related expecitng string.
Close-Bug #1231871
Change-Id: Ia998cdb6978fc024dd0d3c9bd161fbdebe68638a
The "shelve" API, which powers off and snapshots a vm instance, has been
implemented by Nova-server side.
In addition, thare are two relational API "unshelve" and "shelveOffload".
This patch adds three commands for using these APIs.
Fixes bug #1231827
Change-Id: Ic2ad1bb537efb40a3155e9f3c7b63e09e82be7f1
When using os_cache for the auth_token, if username and password
are available when a token fails to validate/authenticate, attempt
a reauth behind the scenes.
The helper object for stashing the auth_token doesn't handle flushing
the cache. This is valid behavior because the result would be the
same as if a bad username/password were issued (401 Unauthorized).
Fixes-bug: 1214658
Change-Id: I107fc999610bb7638cefcb5d195aeafdcd663ca6
If authenticating with a valid token (i.e., token auth, not
username/password auth), novaclient would instruct keystone to issue
a new token with an identical expiry to the one used, and pivot
onto it. This makes it appear as though Nova is leaking Keystone
tokens.
Since there's zero benefit to issuing a new token that is ostensibly
identical to the perfectly good token used to authenticate, make
novaclient keep using the token it already has after successful
validation, and not issue a new one.
This patch set adds a new pair of tests to the
AuthenticateAgainstKeystoneTests class, which parrot the current
authentication pass/fail tests, but exercise the new code paths
Also adds a fix by Joe Gordon to make os_cache work correctly.
Change-Id: Ic4f0e6d506d8d81f0b1d46138e7e19d3b3392e1d
Fixes: Bug 1197201
Related-Bug: 1214658
Python 3 doesn't support str.encode('base64'), we should use the
module "base64" instead.
Close-Bug #1229161
Change-Id: I1432952558f8c5c3cff39761306e91916d80207f
- Corrected places where `dict.keys()` was being treated as a list
- Corrected usage of `urllib.urlencode()`
Change-Id: I0a24b2f64fab6c905e20073ff7ebaa3c5ffe7c90
Under Python2 dict.keys() returns a list, under Python 3 it returns an
iterator. Some places assumed that if they called keys() then it was
safe to modify the dict in a loop. Corrected this by calling list().
Change-Id: I7638263f288dd20590bd751d09194a919b921545
In python 3, dict.keys() is a class of 'dict_keys', it does not
support indexing.
Cast the dict to list to get the "first" value of dict, which is
compatible with python 2&3.
Closes-Bug: #1229005
Change-Id: I561b7ada9e5ad936659a657b3161a9b93a15a788