803 Commits

Author SHA1 Message Date
Sean Dague
5869abc531 fix novaclient functional tests for new devstack config
The novaclient functional tests assumed computev21 as a type in the
service catalog. We're defaulting compute in devstack to v21 now, so
this no longer works. This is probably far too coupled to devstack
atm, however until we get to unversioned service catalog, this is what
we need to do.

Change-Id: Ifb0056924b20f62d75d13a7b4aae829df61a5396
2015-09-03 13:19:28 -04:00
Matt Riedemann
eaf1e56b21 Update path to subunit2html in post_test_hook
Per:

http://lists.openstack.org/pipermail/openstack-dev/2015-August/072982.html

The location of subunit2html changed on the images in the gate
so update the path used in the post_test_hook.

Long-term we should just use what's in devstack-gate.

Change-Id: I5e50e7d7ad845aba26403df1df412c0a139a6dc7
Closes-Bug: #1491646

--------------
squashed with:
--------------

Don't pass null device when attaching a volume

The v2.1 API schema rejects null device values in an
os-volume_attachments request, so only include the device in the request
if one is specified on the command line.

Closes-Bug: #1491325

Change-Id: I4fa4019f19f9af6ff350db2fb6e524fa8570a6f3
2015-09-02 19:08:09 -07:00
Artom Lifshitz
3d9c01b2d3 Option to specify max servers for live evacuate
The current behaviour of live evacuate is to naively request that all
servers on the hypervisor be evacuated. The more VMs are migrated
simultaneously, the more bandwidth is required. Once a certain number
of migrating VMs is reached, there is not enough bandwidth to cope
with the rate at which they dirty their memory. The migrations will
thus never complete.

The correct solution to this would be a whole lot of work on the Nova
side. As a stopgap measure, this patch introduces a --max-servers
option to host-evacuate-live. With this option, the user can control
the number of VMs that are live-migrated at the same time, thus
allowing the user to avoid the dirty memory scenario described above.

Change-Id: I17bad5f3253d6657fc1e6610159fc8e3921e6ea4
2015-09-02 17:13:47 +00:00
Jenkins
893bf9313c Merge " Allow to reboot multiple servers" 2015-09-01 15:57:50 +00:00
Jenkins
fa0c063d53 Merge "Add method for better random name" 2015-08-31 22:07:08 +00:00
Cedric Brandily
9b7dd38d8f Allow to reboot multiple servers
This change allows to pass multiple server names/ids to nova reboot.

Change-Id: I7ad891beafba019c262f656aa3e78686336e072b
2015-08-31 23:11:53 +02:00
Kyrylo Romanenko
3f105a5989 Add method for better random name
New method generates randomized name for entities.
This method allows to set prefix that explicitly shows
what kind of entity we have. This should be more useful than
UUID-only names.

Change-Id: Iafec7686f1b3b00cb21302ee0e5db40d74e77c81
2015-08-31 17:05:13 +03:00
Jenkins
d27568eab5 Merge "Add mechanism to vm list to return all resources" 2015-08-27 18:38:15 +00:00
Andrey Kurilin
b80ac974e3 Add mechanism to vm list to return all resources
This patch adds a loop to servers list, which makes calls to API side until
all resources will be listed.

Also, there are several functional tests are added with checks of markers
and limit.

Change-Id: Ic030a68867781cca25e723ab51986d87ecd3ab2e
2015-08-27 12:48:05 +03:00
rahulram
43520009de Fixed typo Errors in comments
Change-Id: Id821aefe825226e9a96e90c6e89d4f715280acdc
2015-08-26 14:07:16 -07:00
Andrey Kurilin
d106dd485b Add "limit" option to servers list cli
This option is supported by both API and "novaclient-as-a-lib" sides, but
was missed from CLI.

Change-Id: Ie85949a7d7040f73b97b0676c5d574ede5a3034e
2015-08-25 20:25:28 +03:00
Andrey Kurilin
a708190499 Add 'marker' argument to server list cli
Nova API side supports returns limited number of resources, option "marker" is
already supported by "novaclient as a lib" and allowes to list servers
after "marker".

Change-Id: I04c42858a19b2afed37f967c14234291203e6c1e
2015-08-25 20:12:10 +03:00
Jenkins
72190ba9a2 Merge "Fix versions.list for v2.1 Nova API" 2015-08-24 23:19:10 +00:00
Feodor Tersin
b6130e2e18 Fix a fault of request logging with no credentials
If a user doesn't specify for novaclient's Client neither credentials
nor auth token, but specifies http_log_debug=True, and requests Nova
version list, novaclient fails with AttributeError exception.

The reason is that obfuscation of auth token doesn't expect None value
of the token. This patch bypass obfuscation of None token.

Closes-Bug: #1488169
Change-Id: I3712d633719bc77310ce863da33b2eec59a7ce91
2015-08-24 19:46:17 +03:00
Jenkins
63a32946c7 Merge "Specify NIC option for nova boot" 2015-08-21 19:13:39 +00:00
Feodor Tersin
bf91805f35 Fix versions.list for v2.1 Nova API
novaclient transforms its management_url to get an url for a request for
server versions list. Currently this transformation does not consider
that version part of an url can be complex and contain major and minor
parts. As a result versions.list does request on a wrong url and fails
with NotFound error.

This patch adds support of version formats like 'vN.N', 'vN.NN', etc.

Partial-Bug: #1483030
Change-Id: Ie105bec37ee41c6a77ffc5f1cf680bbf88846159
2015-08-21 22:04:15 +03:00
Jenkins
a695683775 Merge "Allow display project-id for server groups" 2015-08-17 16:19:01 +00:00
Jenkins
17a37e5760 Merge "Copy cli arguments in api_versions.wraps decorator" 2015-08-17 16:18:58 +00:00
Andrey Kurilin
a570b60d67 Copy cli arguments in api_versions.wraps decorator
novaclient.api_versions.wraps decorator can be used in shell. Most of shell
function has cli arguments which are added via another decorator.
Currently, to keep this cli arguments, novaclient.api_versions.wraps
decorator should be used in the top of decorators. Something like:

    @api_versions.wraps("123.456")
    @cliutils.arg("name", help="Name of the something")
    @cliutils.arg("action", help="Some action")
    def do_something(cs, args):
        pass

This patch adds ability to put api_versions.wraps decorator everywhere:

    @api_versions.wraps("123.456")
    @cliutils.arg("name", help="Name of the something")
    @cliutils.arg("action", help="Some action")
    def do_something_1(cs, args):
        pass

    @cliutils.arg("name", help="Name of the something")
    @cliutils.arg("action", help="Some action")
    @api_versions.wraps("123.456")
    def do_something_2(cs, args):
        pass

Related to bp api-microversion-support

Change-Id: I8d599b712b17dcfc0be940a61c537d2dfe1b715b
2015-08-11 14:40:05 +03:00
Kevin_Zheng
01c2e60eb3 Allow display project-id for server groups
Currently, the display of server groups doesn't contain informations
about project-id. It is very difficult for admin to tell which
group belongs to which project when using command:
"nova server-group-list --all-projects".

This patch adds project-id to the display.

Change-Id: I010bf02f696396c404bc7a51ce93252c8c7f68a6
Partial-bug:#1481210
2015-08-11 03:24:56 +00:00
Carlos Goncalves
39739158b0 Support forcing service down
Extending Nova CLI to support forcing service to be set/unset as down,
as specified in blueprint mark-host-down.

Depends-On: I612582ba7b70bb6d167aa68bdfc47faa3b7b85ed
Depends-On: I39f1a84c100726f87a4dc464dd9922d66efdb53f
Implements: blueprint support-force-down-service
Change-Id: I2b80ac32a95fe80363b4ad95d8d89fff097935a3
2015-08-07 17:47:59 +01:00
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