'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
The Nova API supports both a basic (id and name) and detailed server
list, and this is supported in the client by the "detailed=True"
argument to servers.list(). However the shell do_list() method always
leaves this to its default value. For administrators on a large
system, or where the tenants has a lot of instances a detailed list
can be painfully slow.
This change adds support for a --minimal option to list.
Fixes bug: 1228137
Change-Id: I3126ee6b372606a98f0d7a4e344556f8c05ae224
Some of the host code required changes to work with the v3 API.
This change adds a v3-compatible HostManager that inherits from
the 1_1 HostManager to make use of the functions that didn't
need to change.
bp v3-api
Change-Id: I3ef7ab4619d49c20ab1bdeb1185ad28b411d37a1
Create a basic framework that inherits from v1_1 and can be
overridden as necessary in extension commits
bp v3-api
Change-Id: I611451e50a9e553a18777fa48f32e368b919605e
Client.__init__ method used self.os_cache variable in an internal method call
though this variable had not been initialized earlier.
In addition, unittests added for full coverage of client v3.
Change-Id: I421f82932b65f137932d933e04d42064bec0d08d
The newer version of six (1.4.1) provides six.StringIO which
is a fake file object for textual data. It's an alias for StringIO.StringIO
in python2 and io.StringIO in Python3.
Use the fake object where approiate.
Change-Id: I364001933b4f2305ac27b293a9a4a3fec36c8a49
Signed-off-by: Chuck Short <chuck.short@canonical.com>
In tempest, some tests use delete() method of each resource class
(Server, SecurityGroup, etc.) for cleaning up when each test finishes.
Now we are adding some tests, which create a Flavor instance, to tempest
and we need the delete() method of Flavor class.
Fixes bug #1218156
Change-Id: I210d62aa45510858346315046cf57ea7b1de7b7b
Add new arguments and syntax for booting from a block device mapping
that use the new os-block-device-mapping-v2-boot extension. These
allow to:
* boot from an image, volume or snapshot (--image, --boot-volume, --snapshot)
* attach any type of block device (--block-device).
* attach an swap disk on boot (--swap).
* attach an ephemeral disk on boot (--ephemeral).
blueprint: improve-block-device-handling
DocImpact
Change-Id: I1aadeafed82b3bd1febcf0d1c3e64b258d6abeda
Administrator cannot use the flavor name in arguments of
"nova flavor-access-add" and "nova flavor-access-remove".
This patch fixes this problem.
Change-Id: I68b267dc071382f1978efc2088cd8e837455e8b4
Related-Bug: #1205298
This patch adds support for the assisted volume snapshots API extension.
This is used by Cinder to ask Nova to perform a volume snapshot on its
behalf. It's required when the volume is actually file backed (like
qcow2) and the hypervisor needs to be involved in the snapshot
operation.
Required for blueprint qemu-assisted-snapshots
Change-Id: I50ee9bf92c8de98528638d1724fe35e07bed729e
Bug 1209242
nova-api has supported pagination for long. A marker and limit
option could be passed to nova-api to get a slice of instances.
It makes sense to enable this feature in novaclient, so that
horizon could use it for pagination supporting. Modification to
shell.py would be submitted in a separate patch.
Further change will also pass 'sort_key' and 'sort_dir' to
nova-api, as long as nova supports this.
This is part of blueprint support-pagination-for-instance-list
Change-Id: Ieb5f2c1eb31b9f7e95b62b51ea7dc338e3970d04