_add_details() method copies keypair attributes retrieved
from Nova to an instance of Keypair class. Trying to set
attribute 'id' fails with AttributeError, because Keypair
class has a read-only property 'id'.
We can safely omit setting of attribute 'id', because it's
just an implementation detail (the id of a table row in a
database), and keypairs for a given tenant are uniquely
identified using attribute 'name'.
Fixes bug 1223934
Change-Id: I1045730e47e9e6ad31fcdfbaefdad77e2f3b2c3e
- Corrected places where `dict.keys()` was being treated as a list
- Corrected usage of `urllib.urlencode()`
Change-Id: I0a24b2f64fab6c905e20073ff7ebaa3c5ffe7c90
nova client was using terms "server" and "instance" interchangeably
which was very confusing.
This patch uses "server" where possible without touching the API.
Note that there are actions (instance-action, instance-action-list) and
arguments (--instance-name, --num-instances, ...) with "instance" in their
name which can't be changed easily.
Closes bug 1156648
Change-Id: I0570aa1c4dc9ad1852af307a2a4896f16073a6ab
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
We've discovered that having versions in setup_requires leads to evil
and death. Also, the setup-hooks in setup.cfg are completely unnecessary
anymore.
Change-Id: I8878e635e0828bbddb81d9c6321a9f10ad3b89fe
OpenStack runs a git service now, so instead of linking to github URLs,
link to git.openstack.org.
Versions for pbr in setup.py actually wind up being an error (and a very
odd one) Remove them.
The setup hook in setup.cfg is no longer needed.
Change-Id: I8f48ac194e6c01e9bb06fa5df6f2b2bf28c01636
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
Closes Bug:#1220703
Modified --num-instances flag description in shell.py to clarify that
number of instances spawned are limited by the quota.
Change-Id: I29fa175f310ab1e073dca5f453a3540dcdde933d
Signed-off-by: Abhishek Lahiri <aviostack@gmail.com>
Right now the cli was already adding a block device when it was passed
an image_id to boot from and more than one block device mapping v2. This
is done because nova expects the image to be another block device
mapping and would ignore it otherwise.
This patch moves this functionality from the cli to the base module so
users of the module can benefit from this and also to prevent some
misunderstandings that may arise when using BDMv2 and the image gets
ignored by nova. In the future we should handle this in the nova side
assuming a new BDM when an image is provided.
Fixes bug #1225061
Change-Id: I29f31c24f958cfa8b68b33edc63e0d7031aa241f
In python3 dict.iteritems(), dict.iterkeys(), and
dict.itervalues() are no longer supported. So use
six.iteritems() where it is appropriate.
blueprint python3-novaclient
Change-Id: I8c39bfe426d08d36215b55c3245dcfc69ec72517
Signed-off-by: Chuck Short <chuck.short@canonical.com>
While running unit tests with python3, we get the following traceback:
TypeError: 'map' object is not subscriptable
In python3, a map returns an iterable object of type map,
and is not subscriptable.
Refactor to not use indicies so that it is python2 and python3
compat.
blueprint python3-novaclient
Change-Id: Iaf0de19f08fa3e91ee79c174ccc86a8bbe4acdc8
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Python3 uses the the concepts of text and (binary) data
instead of Unicode strings and 8-bit strings. In python3
all text is unicode; however encoded unicode is represented
as binary data.
Use the six module to use six.binary_types and six.text_types
where apporiate:
- six.text_type unicode() in python2 and str in python3.
- six.basestring() in python2 and str in python3.
blueprint python3-novaclient
Change-Id: Ie7b393abe6beac22eaf127b7fc7bbc372c338211
Signed-off-by: Chuck Short <chuck.short@canonical.com>
While running the unit tests with python3 the following
traceback appears:
TypeError: can't use a string pattern on a bytes-like object
This is due to the way that python2 and python3 handles unicodes.
Change-Id: I401f1cefed69780073222cae98d8da4c3d8031a8
Signed-off-by: Chuck Short <chuck.short@canonical.com>
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>
Update oslo from oslo-incubator includes various python3
fixes.
Change-Id: Ie30a4c319125c3d4fb704254f8553bc8fd960eae
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