842 Commits

Author SHA1 Message Date
melanie witt
a820c45543 Use v2.0 in clouds.yaml auth_url for functional test job
Commit 050a0d5b304a013e23cd5909abf6e11b7dda5f18 changed the defaults
in devstack to use the keystone v3 api. This broke the novaclient
functional test job because novaclient doesn't yet support v3
and relies on having "v2.0" in the auth_url.

This appends or replaces the version in the clouds.yaml auth_url
to v2.0 to enable the functional test job to work until v3 support
is added to novaclient.

Closes-Bug: #1506103

Change-Id: I75c5efd039b71c8855acf21c5516ccbeeaaeadb3
2015-10-16 22:47:37 +00:00
liyingjun
986ed2ae0b Add sort_dir/key to flavor list
'marker' and 'limit' are already added to flavor list, but 'sort_key'
and 'sort_dir' which are useful for pagination are missing.

Closes-bug: #1505939
Change-Id: Id78595f15fbb289133092a32238238e3c4a9d0a0
2015-10-15 08:33:38 +08:00
liyingjun
49e76e670b Add pagination params for flavor list
Mission 'marker' and 'limit' params for `nova flavor-list` shell
command. It would be nice to have this when there are many flavors.

Change-Id: I4579b63bc6c711f1b5eaf07b54d393ebcbfd8277
Closes-bug: #1505874
2015-10-14 10:38:13 +08:00
Thomas Bechtold
afaa8a2d1e Increase timeout when testing admin timeout
When running functional tests in a slow virtual environment,
the given timeout of 10 seconds to list thr available instances
is not enough. Increase the timeout to not run into
a "timed out (HTTP 408)".

Change-Id: Ie2345e6858bcc97095863d5d388bacf9c29b7682
2015-10-13 19:12:58 +02:00
Jenkins
03f1f67ccd Merge "Revert "Allow display project-id for server groups"" 2015-10-05 20:56:52 +00:00
Matt Riedemann
469d06837c Revert "Allow display project-id for server groups"
This reverts commit 01c2e60eb3f3718884dd77cb05b4cde76052fb9d

The server side change isn't in yet, there is a spec
proposed:

I167141676ef4f597a1c022c1fd5dc96fd55d02ad

So this should have never landed in the client.  And when
it does it should be using microversions, like we have for
the v2.4 support added in:

5fdb861ad4835513c0cb78251cce85ac73f51dd4

Change-Id: If3196093036c72f0f86cdca98a016b9f4fff0923
2015-10-05 18:12:23 +00:00
Jenkins
b7e647427d Merge "Test that microversions are not skipped" 2015-10-05 16:21:16 +00:00
Jenkins
8971193286 Merge "Add --metadata as optional input when do nova image-create" 2015-10-05 15:18:20 +00:00
Andrew Laski
4bd50d5e41 Test that microversions are not skipped
When raising API_MAX_VERSION to support a new Nova API microversion
there should be support added to some method to account for the change.
A test has been added to catch if support has not been added.  In the
event that no methods need to change there is an exclusion mechanism in
the test so the version and a note can be added there.

Change-Id: Iebc1be2557e1b6eec327b703568805578e564172
2015-10-02 16:11:20 -04:00
Matt Riedemann
d045019f0f Set DEFAULT_OS_COMPUTE_API_VERSION to 2.5
The client currently implements support for microversions 2.2, 2.4 and
2.11.

According the nova API microversion history:

http://docs.openstack.org/developer/nova/api_microversion_history.html

2.3 just returns extra attributes in the response so it's not a problem
for the client. We should expose those at some point but it's not a
breaking change.

2.5 is a server-side only change since the client allows filtering
servers by IPv6 address but the server wasn't honoring that until 2.5.
There are no client side changes for that microversion.

2.6 is the first backwards incompatible microversion since it replaces
the old specific console APIs (RDP/serial/SPICE/VNC) with a new generic
remote-consoles API. The client must be updated to handle this since
requesting any microversion >=2.6 for consoles will fail right now. This
is exposed on the CLI right now because the CLI defaults to the 2.latest
microversion.

So even though the client actually supports the 2.11 microversion, we
shouldn't default to higher than 2.5 because we have gaps in handling
2.6->2.10.

This change fixes the default for the CLI by setting
DEFAULT_OS_COMPUTE_API_VERSION=2.5.

Partial-Bug: #1500688

Change-Id: I52074f9a3e7faa6a7a51c3fa9766100acf25dee2
2015-10-01 14:18:05 -07:00
melanie witt
abd0630bad Always send volume_id when booting with legacy bdm
Commit 5153dcda807c554769081626c10c43d16adea671 removed bdm v2-only
request parameters to pass nova api v2.1 schema validation, but also
removed the ability to boot with legacy bdm specifying volume_id only.

This adds volume_id back to the request for legacy bdm when
no other parameters are specified.

Closes-Bug: #1501435

Change-Id: Ie8c56c28492793990ef7ed6dc54768cef9e28a98
2015-10-01 10:55:47 +00:00
Kevin_Zheng
3866bfb297 Add --metadata as optional input when do nova image-create
Currently, when using nova image-create, we are not able to
input metadata for the snapshot, and it is always set to be
None.

This patch add --metadata as an optional input when calling
nova image-create.

Change-Id: Ic72dc3652a77cfad099e144423302042a47f6e1e
Closes-bug: #1500727
2015-09-30 09:22:07 +08:00
Andrey Kurilin
0cd58123be Remove novaclient.v1_1 module
A long time ago in a galaxy far far away...this module was deprecated
(see 0a60aae852d2688861d0b4ba097a1a00529f0611 for more details) and
it's time to remove it(one full release of deprecation (Liberty) is 
ended).

Also, let's stop testing compute-api-version=1.1 .

Change-Id: I2ce177d8074921a54b4e3d1bfe3b794a80df9358
2015-09-29 11:50:59 +00:00
Andrey Kurilin
0455932c3a Split functional tests for legacy(V2.1) and microversions
It would be nice to ensure that fundamental use-cases of novaclient work
for both legacy(V2.1) and for microversions(latest or specified microversion).

Change-Id: Icae73dd221c9787fd08facc8642c5b564e82393a
2015-09-21 12:07:18 +03:00
Andrey Kurilin
2793331d01 Specify api_version for functional tests
Most of functional tests are written for V2.0/V2.1 API version, but
launched on "latest" compute api version('--os-compute-api-version'
flag is not ovveriden + default value of it is "latest").

This patch adds "COMPUTE_API_VERSION" parameter for base TestCase,
which sets --os-compute-api-version flag while running "nova" shell.

Change-Id: I5d711438addaba5282a15fd2b9dde1800f7d7b91
2015-09-21 12:05:46 +03:00
Jenkins
527df930be Merge "Encode unicode filter arguments for server list" 2015-09-19 03:24:39 +00:00
Jenkins
2dff4b05dd Merge "[docs] Fix length of underline" 2015-09-18 18:33:03 +00:00
Richard Jones
485201453a Encode unicode filter arguments for server list
Previously unicode arguments were not encoded so unicode
exceptions were thrown when the arguments were URL encoded.

Change-Id: I69a5ac8dcf584ad5b5604caf3c4cb16bb59d3fe3
Partial-Bug: 1472999
2015-09-18 11:45:50 +10:00
Jenkins
64c8039c1e Merge "Show reserved status for a fixed_ip if available" 2015-09-17 21:26:49 +00:00
Jenkins
4d5cfdead0 Merge "Fix nova bash-completion needs authentication" 2015-09-17 20:50:44 +00:00
Andrey Kurilin
420782cc01 [docs] Fix length of underline
Title length must match the underline

Change-Id: Ia7a2bf54a6697c63c423bacd53dfb125b9c620f6
2015-09-17 16:07:11 +03:00
Atsushi SAKAI
b1204446ef Fix nova bash-completion needs authentication
CLI-Reference generator requires
   (openstack-doc-tools/bin/doc-tools-update-cli-reference)
  that command line help and bash-completion running without authentication.

  For this purpose, remove authentication check in command and its test.
    Fix nova bash-completion works without authentication.
    Fix nova bash-completion test without setting authentication infomation.

  Define skip_auth for descriminate "nova bash-completion" and do_help.

Change-Id: Ic1a7f84b1b9cb7e8be6721c1b8096f49e9e9ab33
Closes-Bug: #1495424
2015-09-17 09:20:48 +09:00
Matt Riedemann
5fdb861ad4 Show reserved status for a fixed_ip if available
Commit 8886590f30daf736ae30a95b3e4a77cb586d4f02 adds the v2.4
microversion to nova so that we can get back the reserved value of a
fixed IP.

This change adds support to novaclient to display the reserved status
from the fixed_ip resource if it's available in the response.

Related blueprint show-reserved-status-in-os-fixed-ips-api

Change-Id: Idf3df1728ba87006d1b0f82a1c01712202670e0a
2015-09-16 14:21:37 -07:00
Jenkins
0820a9e793 Merge "Remove redundant help command test and commonize" 2015-09-16 15:53:16 +00:00
Victor Stinner
48f9c5a046 Fix unicode issue in shell.main() error handling
shell.main() uses safe_encode() to encode the exception name and
exception message. On Python 3, it displays:

   ERROR (b'Exception'): b'message'

instead of:

   ERROR (Exception): message

Don't encode exception name and message on Python 3. Use
exception_to_unicode() of oslo_utils.encodeutils to get the exception
message as Unicode. On Python 2, let print() encodes the Unicode to
the encoding of sys.stderr.

Blueprint nova-python3
Change-Id: Ib5568546d2aedb2b28c05d840b9ba34f697384ec
2015-09-15 09:53:15 +02:00
melanie witt
b4e9af99d7 Remove redundant help command test and commonize
This is a follow up patch to https://review.openstack.org/#/c/221488/
which added unit tests for 'nova -h' and 'nova --help' and commonized
some code. It was missed that a test for 'nova' without any options or
subcommands already existed as "test_help_no_options"

This patch also refactors "test_help_on_subcommand" use the common
"_test_help" function since that was also missed.

Change-Id: Iccaf91207ba35001c8f58abb550cd1c3be542b38
2015-09-15 00:20:23 +00:00
Jenkins
37d1e29a0b Merge "make sure os_password is set for auth_plugins" 2015-09-11 17:06:35 +00:00
Jenkins
382af52544 Merge "Add unit tests for different help commands" 2015-09-11 11:30:29 +00:00
Jenkins
31d4e026b4 Merge "[BugFix] Change parameters for legacy bdm" 2015-09-10 23:58:15 +00:00
Daniel Wallace
b547a3da50 make sure os_password is set for auth_plugins
os_password is not set anywhere for auth_plugins.  It is only set for
keystone sessions.  This makes sure that it gets set before being passed
to Client.

Closes-Bug: #1493977
Change-Id: I94421fd6fa58be391dfe8a9a14479bb4c17c5231
2015-09-10 16:50:28 -05:00
Jenkins
5f8754f64d Merge "Fix bugs with rackspace" 2015-09-10 18:10:54 +00:00
Andrey Kurilin
5153dcda80 [BugFix] Change parameters for legacy bdm
`_parse_block_device_mapping` method was design to support both
bdm v1 and v2. The implementation is based on the fact that API side
ignores unknown/incorrect parameters, so `_parse_block_device_mapping` compose
equal parameter for bdm v1 and bdm v2. Since Nova V2.1 contains schema checks,
such implementation stoped working.
Despite the fact that novaclient.v2.servers contains separate logic for bdm v2,
we can make `_parse_block_device_mapping` works only with legacy bdm and
in future patches make it works for both bdm v1 and bdm v2.

Change-Id: I37c00ac77b1a3b500221d779533532e9f43e5277
Closes-Bug: #1491737
2015-09-10 20:44:49 +03:00
Jenkins
6ecc81b89b Merge "Option to specify max servers for live evacuate" 2015-09-10 16:21:06 +00:00
Daniel Wallace
b2221c8a70 Fix bugs with rackspace
not all apis have the versions available

Rackspace api does not open up for querying versions.  This causes it to
still break when using the rackspace-auth-plugin

add tests for api_version Unauthorized

make sure that the list can still run even if the api_version check is
unauthorized.

Closes-Bug: #1493974
Closes-Bug: #1491579
Change-Id: I038b84bad5b747a0688aef989f1337aee835b945
2015-09-09 14:47:20 -05:00
melanie witt
d0b44893ac Add unit tests for different help commands
Related-Bug: #1491677

Change-Id: I7e6b74e60dafa0e869a5b3355793cda1cf08c389
2015-09-08 20:11:17 +00:00
Jenkins
9e15b3d7c0 Merge "[Bug-Fix] Update requests body for quota-update" 2015-09-04 17:33:13 +00:00
Andrey Kurilin
6fc3a943e6 [Bug-Fix] Update requests body for quota-update
Update quotas API call doesn't accept parameter "tenant-id".

Change-Id: I1cbc6088c5deeb32e4e98ef1ced5f83ce71fe3ab
Closes-Bug: #1492242
2015-09-04 17:49:27 +03:00
Sean Dague
e4b0d46c4b workaround for RAX repose configuration
The RAX Repose environment is blocking access to the API version
information by local policy, returning a 401 before we even get to
Nova itself. While this in clearly incorrect behavior, it is behavior
in the field, and we should not break all our users on that cloud.

This catches the 401 and translates that so that it's the equivalent
of only supporting v2.0. We will be taking these API calls to defcore,
and intend to remove this work around once that is done.

Change-Id: I2072095c24b41efcfd58d6f25205bcc94f1174da
Related-Bug: #1491579
2015-09-03 14:13:33 -04:00
Sean Dague
c915757ed5 Don't assume oscomputeversions is correctly deployed
The paste pipeline that's "above" the /v2/ and /v2.1/ urls is the
oscomputeversions dispatcher, which should provide 300 redirects to
versions in question. Previously the code that was trying to discover
information about the current version did so via a GET of something
that looked like /v2. On an upstream compatible OpenStack this
actually triggers a 300 and redirect to /v2/ for the real answer.

On deployed public clouds, oscomputeversions is sometimes not deployed
at all, or front end blocking by the load balancer does
weirdness. Sometimes with a 401, sometimes a hang.

This fixes the way that first request is made that should avoid the
300 redirect entirely. The code probably should have done this
originally, but it was tested with upstream configuration that worked
fine in this case.

This fix is tested against HP Cloud (the only pub cloud I have creds
with). Before this fix "nova list" hangs trying to get the supported
versions, after the fix it works as expected.

Change-Id: I1692380fe8d340e5c044f46dd0b103c7550d2c7d
Closes-Bug: #1491579
2015-09-03 13:19:28 -04:00
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