832 Commits

Author SHA1 Message Date
Jenkins
46289cafef Merge "Adds support for x509 certificates as keypairs" 2015-08-07 13:33:38 +00:00
Jenkins
e89e5fe1bb Merge "Set "latest" as default compute api version" 2015-08-07 13:33:31 +00:00
Jenkins
59abce6462 Merge "Add version discover and check in CLI" 2015-08-07 13:33:19 +00:00
Claudiu Belu
4a812d953b Adds support for x509 certificates as keypairs
Adds new parameter --key-type for novaclient for creating x509
certificates as keypairs. If no --key-type is specified, a ssh
keypair is created, for backwards compatibility.
Adds 'Type' column for keypair-list, displaying the keypair type.

This commit will have to merge after:
https://review.openstack.org/#/c/140313

Depends-On: I215662f2f92a01921a866c3218031787a9eaf915

Implements: blueprint keypair-x509-certificates

Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I12bb13e24b660ffb6da0e5be275acbba7453d011
2015-08-05 19:55:48 +00:00
Andrey Kurilin
02889515a5 Set "latest" as default compute api version
It would be nice to use "latest" version of api by default.

Related to bp api-microversion-support

Change-Id: Ife981c87d32011f01fcbdf871071a9d8273ebb92
2015-08-04 16:15:05 +08:00
Andrey Kurilin
9ed9ab68f7 Add version discover and check in CLI
This patch adds version discovery when user request with latest version.
The latest version means the most recently version between server and
client.

Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I0b7a95e77371aef6e349bf54b5dd6ce6c6d2732c
2015-08-04 16:15:01 +08:00
Jenkins
7c18da6e64 Merge "Refactor and update test_instances and test_volumes_api" 2015-08-03 02:09:23 +00:00
Jenkins
623cfd5c19 Merge "Add 'deleted' status check in _poll_for_status" 2015-08-03 01:53:10 +00:00
Kyrylo Romanenko
c0c17099a5 Specify NIC option for nova boot
Choose first network from networks list and specify
it for nova boot. Otherwise nova can not boot instance
when more then one network available.

Change-Id: I4813f6fff3050e2141e3a5e8eb4d7d8919721703
2015-07-30 19:10:50 +03:00
Kyrylo Romanenko
089318d831 Refactor and update test_instances and test_volumes_api
Add method wait_for_volume_status to base.py to deduplicate code
in test_instances.py and test_volumes_api.py.
Removed volume_id_from_cli_create function as obsolete.

Change-Id: I44e35e181515923a677b336ed48bc705cf673134
2015-07-30 17:44:50 +03:00
Ian Cordasco
c69c38c58f Use keystoneclient's TCPKeepAliveAdapter
When novaclient isn't using a session from keystoneclient, it needs to
set reasonable TCP Keep-Alive values otherwise the operating system
defaults may cause the client to hang for hours before a connection will
time out. Using keystoneclient's adpater (which sets good defaults) will
allow us to not have to maintain this adapter here and to benefit from
their defaults.

Closes-bug: 1477275
Related-bug: 1323862
Depends-On: Ibd53ae2d4d2455db0ebc9951e5c764befc57850f
Change-Id: I1924bd96eb1a4bac5d57a5cc5d5461acb3f7f5ac
2015-07-28 20:20:29 -05:00
Jenkins
9efeb79660 Merge "Add "get_current" method to VersionManager" 2015-07-28 17:56:08 +00:00
wangxiyuan
ba79073d7b Add 'deleted' status check in _poll_for_status
When use command '--poll' to show progress, if the object's staus change
into 'deleted' for some reason, it will lead a endless loop.Becasue there
is no check about 'deleted' status.

For example, when use 'image-create --poll' to create a vm's snapshoot,
if glance's quota is small than the snapshoot, the image will be deleted.

Change-Id: I028e3064b3371f87873d74494c39255775a2c818
Closes-bug:#1470047
2015-07-28 11:05:04 +08:00
Jenkins
40a4070f28 Merge "Implements 'microversions' api type - Part 2" 2015-07-27 23:13:36 +00:00
Andrey Kurilin
eddb4d61c2 Add "get_current" method to VersionManager
get_current returns the current endpoint's API version info.

Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I36e84680c578a88d5c274f8ca24ecd18d1f3a179
2015-07-27 19:55:37 +08:00
Jenkins
6e192c8087 Merge "rename root-password to set-password" 2015-07-27 11:39:37 +00:00
Jenkins
39ae4c2870 Merge "hypervisor command can't use cell format id to show hypervisor" 2015-07-27 11:03:59 +00:00
Andrey Kurilin
936cf572df Implements 'microversions' api type - Part 2
New decorator "novaclient.api_versions.wraps" replaces original method with
substitution. This substitution searches for methods which desire specified
api version.

Also, this patch updates novaclient shell to discover versioned methods and
arguments.

Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I1939c19664e58e2def684380d64c465dc1cfc132
2015-07-25 15:57:17 +08:00
Jenkins
169b8a08ce Merge "Improve hypervisor-show print list" 2015-07-24 22:38:18 +00:00
James Penick
3bf6f8fe99 rename root-password to set-password
all references to `root password` have been changed to `admin password`
but the `root-password` command remained. This changes it to
`set-password` which is less ambiguous and consistent with existing
commands `clear-password` and `get-password`

Change-Id: I8683e4ecd4d9294989eb3d8d27d1fb75c16b261b
2015-07-22 19:32:55 +00:00
Chung Chih, Hung
c3a0c035dc hypervisor command can't use cell format id to show hypervisor
This bug was occurred in cell mode.

In cell mode, compute node's id was not identified by integer type. It
was formatted with "path!to!cell@ID".
Therefore we can't using the id of hypervisor-list output.

For example,
> nova hypervisor-list
+----------------+--------------------------+-------+---------+
| ID | Hypervisor hostname | State | Status |
+----------------+--------------------------+-------+---------+
| region!child@1 | vagrant-ubuntu-trusty-64 | up | enabled |
+----------------+--------------------------+-------+---------+

Change-Id: Iba0cc1993f67351b11d034f372d7a5b98dc017f0
Closes-Bug: 1475973
2015-07-20 04:55:32 +00:00
Andrey Kurilin
ea0b3bd608 Implements 'microversions' api type - Part 1
Compute API version will be transmitted to API side via
X-OpenStack-Nova-API-Version header, if minor part of version is presented.

New module "novaclient.api_versions" was added as storage for all api versions
related functions, classes, variables and etc.

`novaclient.api_versions.APIVersion` class is similar to
`nova.api.openstack.api_version_request.APIVersionRequest`. The main
difference relates to compare methods(method `cmp` is missed from Py3) and
processing "latest" version.

Related to bp api-microversion-support

Change-Id: I0e6574ddaec11fdd053a49adb6b9de9056d0fbac
2015-07-16 16:06:28 +03:00
OpenStack Proposal Bot
d64e288de7 Updated from global requirements
Issue found with mock 1.1.3:

Because of the test inheritance test_keypair_import is getting called
3 times. It appears that the mock for open builtins is getting torn
down after it's first use, and not correctly built again on subsequent calls.

In the gate, this is a race, because we have 3 tests and 8 workers,
and this will only fail if 2 or more of the tests happen to be
allocated to the same worker. This can be reproduced locally with:

  tox -e py27 -- --concurrency=1

Converting this to the context manager usage of mock appears to
resolve the issue.

Co-Authored-By: Sean Dague <sean@dague.net>

Related-Bug: https://github.com/testing-cabal/mock/issues/280

Change-Id: I9a87375d2eb6c7cf7b9124b2095a5a4bcc8e7bf3
2015-07-14 18:52:14 +03:00
rsritesh
a061470a8e Improve hypervisor-show print list
Current hypervisor-show <hostname> command does not properly list
when there is a long list of cpu info feature. The long list of
cpu info feature has comma-separated values.
Because of this user is not able to read the print out properly.

print_dict() has been changed to show a list with comma-separated
values properly.

Change-Id: Icc53439cecd3b5eee2340267a0447ce209d7b653
Closes-Bug: #1466435
2015-07-10 16:13:24 +02:00
Jenkins
002e23d958 Merge "Fix resolving image.id in servers.boot" 2015-06-29 17:44:52 +00:00
Andrey Pavlov
0a8fffffba Fix resolving image.id in servers.boot
Most places resolve id of input parameter as 'base.getid'
and in the beginning of _boot function it resolves image id
with such method. But in fixed place it tries to get id directly
from object. But code that uses novaclient directly(without shell)
falls in this place because it passes string with id to image parameter.

Change-Id: Ib90e4ffa3b7835f6648a62eddf7f7b87b5ab0f7e
2015-06-26 23:27:34 +03:00
Jenkins
7570a8ab46 Merge "Added marker functionality to flavours and images" 2015-06-26 19:45:16 +00:00
Pete Savage
bde241b947 Added marker functionality to flavours and images
Markers to support pagination was missing from flavours
and from images.

Change-Id: I27de83f18a4850b63020ac60e010839a13e916fb
2015-06-26 11:05:10 +01:00
Davanum Srinivas
a5f30d173f cleanup openstack-common.conf and sync updated files
Changes include:
e782594 Add last_request_id only if it is not none
18bf5ca Fix usage of NotFound exception in apiclient.base
3bc8231 deprecate apiclient package

Depends-On: Ia83ef6136da1c551ea947679dc546a0d7ad2f876
Change-Id: I0b5917c657d6adc3d34229b14833a5224c168e07
2015-06-16 20:32:08 -04:00
Jenkins
0d2ed26e7d Merge "Add a sample clouds.yaml" 2015-06-16 19:29:23 +00:00
Artom Lifshitz
3026ea9296 Revert "Allow admin user to get all tenant's floating IPs"
This reverts commit 02328d33373479b33f4fee8112d47c1ae29e8bd4.

As per the comments on the support all-tenants in floatingips-list
spec [1], this patch reverts the --all-tenants flag from
python-novaclient since support has been reverted out of Nova more
than a year ago.

[1] https://review.openstack.org/#/c/171389/

Change-Id: I2d6566ecf59d307e3ea117b3b20dc918c758b63e
2015-06-15 15:25:37 -04:00
melanie witt
9231f939f9 Add a sample clouds.yaml
Since commit 22569f218e4ca461da4e50dfc686adae6a44d2ba functional
testing credentials are managed by os-cloud-config. This change
adds a sample config to help developers run functional tests locally.

Change-Id: I16d1cb9a8bcaf18dda26af596652564b190cbe93
2015-06-15 17:53:21 +00:00
Jenkins
7d12815605 Merge "Pass full path to pkgutil.iter_modules()" 2015-06-14 05:50:03 +00:00
Jenkins
e492327431 Merge "Cache a new token when the existing token expires" 2015-06-11 22:35:30 +00:00
Matt Thompson
84aec86319 Pass full path to pkgutil.iter_modules()
On my production system, when using client version 3, an exception is
raised with an incomplete message as the installed novaclient is
failing to find the bundled client versions.  This commit creates a new
_get_available_client_versions() method and moves the client version
searching from get_client_class() into it.

We also update __get_available_client_versions() to pass
pkgutil.iter_modules the full path to novaclient rather than
'novaclient', which is what actually resolves the issue here.

Lastly, we add a single test to ensure that
__get_available_client_versions() does not return an empty list.

Change-Id: I07ce414863e833c72e50ad8cf1824054cfb41457
Closes-Bug: #1463809
2015-06-11 09:42:02 +01:00
Jimmy McCrory
784a8b4a91 Cache a new token when the existing token expires
The client.keyring_saver attribute was not being reliably set so the
client._save_keys function was not storing any new tokens in the
keyring.

Add a unit test to ensure keyring_saver is being property set.

Closes-Bug: #1397732
Change-Id: If0df24c819d71b4df302309d049079a867a11c76
2015-06-10 23:54:28 -07:00
Jenkins
73957fc5ff Merge "Adds support to set admin password from the cli" 2015-06-09 21:39:21 +00:00
Masaki Matsushita
953a12e986 Adds support to set admin password from the cli
You can set admin password as
nova boot --image <image> --flavor <flavor> --admin-pass <pass> vm-name

Change-Id: I119aba428c15d736e64d990be47cc5c13bb83738
Closes-Bug: #1248517
2015-06-09 13:27:19 +09:00
raiesmh08
09571ba7dc Adding missing nova read only CLI test
1. nova quota-defaults
2. nova bash-completion

Previously these were proposed at  -
https://review.openstack.org/#/c/98735/
Change-Id: I3c2e9aa652cb712b41b9347cb144044012e2338e
2015-06-08 03:25:56 -07:00
Jenkins
072ab6cd5a Merge "add ips to novaclient server manager" 2015-06-03 16:33:59 +00:00
Matt Riedemann
acf6d1fe65 Remove unused novaclient.tests.unit.v2.utils module
This is an old carry over from pre-testtools days and has a nose import.
Nothing is using it so remove it.

Closes-Bug: #1458272

Change-Id: I01b5d35d2e2aec161bd3dbaecb4670ddf3ee8794
2015-06-02 14:14:11 -07:00
Matt Riedemann
23f13437dd Deprecate volume/volume-type/volume-snapshot CRUD CLIs/APIs
This deprecates all of the volume CLIs/APIs that go directly to the
cinder API via the volume service type.

This will emit a warning each time a deprecated CLI/API is used and also
updates the help docs for the deprecated CLIs and docstrings for APIs.

The plan is to do a release once this is merged so people start seeing
it and then we'll actually remove the deprecated CLIs/APIs in the first
python-novaclient release after the Nova server 2016.1 'M' release.

DocImpact: The volume, volume-type and volume-snapshot CRUD CLIs/APIs are
           deprecated and will be removed after the Nova 2016.1 release.
           Use python-cinderclient or openstackclient for CLIs instead.
           Use python-cinderclient or python-openstacksdk for APIs instead.

Related-Bug: #1454369

Change-Id: I4e92f924739de9b664e08117984bfb60359f2212
2015-06-02 14:14:06 -07:00
Jenkins
2fad863909 Merge "server-group-list support 'all_projects' parameter" 2015-05-30 00:43:24 +00:00
Doug Hellmann
e649cea843 Do not check requirements when loading entry points
Update the calls to pkg_resources to avoid forcing a requirements check
when the plugins are being loaded.

There are 2 versions of the entry point API in different releases of
setuptools. In one version, the require keyword argument can be passed
to load(). In the other, separate methods resolve() and require() need
to be used. This change updates the mock and fake objects to support
either, since the fakes are subclasses of the EntryPoint class in
pkg_resources.

It would be better to replace the calls to pkg_resources with stevedore,
which provides a more stable API, abstracts away this difference, and
provides an API for creating test managers directly. That change would
have required more extensive updates to the test suite, though, and
since I'm not as familiar with this code base as others will be, I will
leave those changes for someone else.

Change-Id: I2a9aeb53ccad04c7fa687f25340306b84218f9ff
Partial-bug: #1457100
2015-05-27 18:08:02 +00:00
Kevin L. Mitchell
0a327ce375 Eliminate test comprehensions
The novaclient tests are rife with examples of using a list comprehension
to perform a series of asserts, when a simple for loop would be more
appropriate and more idiomatic; part of the problem is the propensity
for people to cut and paste.  Eliminating the existing examples should
remove the temptation for developers to use this non-idiom to perform
tests.

Change-Id: I2cc8979e720740eae81692a60e30a3d95dce2a2c
2015-05-21 19:12:35 -05:00
Monty Taylor
22569f218e Use clouds.yaml for functional test credentials
devstack emits a clouds.yaml file now, so it can be used for finding the
credentials needed to connect to the cloud for functional testing.

Depends-On: I1150b943f52f10d19f8434b27e8dde73a14d7843
Change-Id: If278565ef07de1a8fef3ff96fc3608e41f3ceea3
2015-05-14 19:55:00 -07:00
Sean Dague
6379287480 pass credentials via config file instead of magic
Passing credentials via an assumed environment inheritance is bad
form, and breaks under new tox. Honestly, we only really need 2 vars
passed in, so we might as well make it a config file that we'll parse.

Add a functional_creds.conf.sample for people to know what one should
look like. Update README to explain it.

Related-Bug: #1455102

Change-Id: Ifdab38a03c94f51d30449149c0dbd9c6265460a5
2015-05-14 10:48:01 -04:00
Rui Chen
9cfecf922a server-group-list support 'all_projects' parameter
Supporting 'all_projects' in server-group-list so that
admin users can list other tenant's server groups.

Change-Id: Ie50288464ebc6585590a1a74efa8804584771ebc
Closes-Bug: #1454523
2015-05-13 16:32:42 +08:00
Jenkins
4aac927894 Merge "refactor functional test base class to no inherit from tempest_lib" 2015-05-08 19:03:31 +00:00
Jenkins
fbcfaca847 Merge "nova client now support limits subcommand" 2015-05-06 22:52:14 +00:00