2534 Commits

Author SHA1 Message Date
Jenkins
9774405f8e Merge "Allow to specify a network for functional tests" 2016-02-18 15:20:56 +00:00
Andrey Kurilin
f279b086d7 [microversions] Enable 2.20
2.20 - From this version of the API user can call detach and attach volumes
       for instances which are in shelved and shelved_offloaded state.

This change changes only server-side checks.

Change-Id: I15a988c730d2fb0be4416dc79b63d357ae990ff7
2016-02-17 13:44:32 +00:00
Andrey Kurilin
55a97ea267 [microversions] Turn off check for header in response
We need to check header only for nova-related calls. While we are unable to
determine nova's calls, let's just temporary disable it now and turn on it
in the future with 2.18 microversion.

Change-Id: I92cecb140fc478f0cf37783d2fcfcaccd935bdfc
NOTE: this check affects only novaclient-as-a-lib
2016-02-16 16:54:07 +02:00
Andrey Kurilin
1d1e43957d [microversions] Add support for 2.19
2.19 - Allow the user to set and get the server description. The user will
       be able to set the description when creating, rebuilding, or updating
       a server, and get the description as part of the server details.

Methods `rebuild` and `create` of novaclient.v2.servers.ServerManager were
not wrapped with `api_versions.wraps` decorator to reduce code and docsting
duplication. Version checks added inside these methods.

Change-Id: I75b804c6edd0cdf02c2cd002d0b5968fec8da545
2016-02-16 16:20:41 +02:00
Ralf Haferkamp
8a2ed13620 Allow to specify a network for functional tests
Currently the tests just attach instances to the first network returned
by "net-list". That might however not be the right thing in some
environments. This change allows to override the default network via the
environment variable "OS_NOVACLIENT_NETWORK". If not specified the
test will fallback to the old behaviour and just use the first network.

Closes-Bug: #1510975
Change-Id: Ie682111127584a33d8e96377d812d3a6352c760d
2016-02-16 12:43:04 +01:00
Cao Shufeng
f535e6945b Provide user with coherent interface to get request_ids
Currently, users must use different interface to get request_ids.
1. Commonly, ListWithMeta, DictWithMeta or TupleWithMeta, etc is
returned to user. And request_ids is returned as an attribute of
*WithMeta.

    For a server delete action:
        result = serverManager.delete(server)
        # result = TupelWithMeta
        request_ids = result.request_ids

2. Some places reutrn a tuple which contains request_ids in one of
its elements.

    For a server stop action:
        result = serverManager.stop(server)
        # result = (Response, TupleWithMeta)
        request_ids = result[1].request_ids

Such kind of difference makes user confused.
This change provides a backwards compatibility solution for users
who don't care about request_ids as TupleWithMeta is subclass of
tuple.

Change-Id: I164bb95abce6dc96cf455033f02822ccb0d87b8f
Closes-Bug: 1542179
2016-02-15 09:49:33 +00:00
Jenkins
99c588e28c Merge "[microversions] Skip microversion 2.18" 2016-02-11 01:33:19 +00:00
Andrey Kurilin
ecaca2279e [microversions] Skip microversion 2.18
2.18 - Establishes a set of routes that makes project_id an optional
       construct in v2.1.

The change on Nova-API side adds only check for existence of
"project_id" at the url. It doesn't check microversion, so all latest
and previous microversions can work with or without project_id.
Proof: all functional tests are succeed on this change (several of them
       use latest microversion).

To cut down "project_id" from the url at the novaclient side, we need to
modify ``novaclient.client.HttpClient`` and
``novaclient.client.SessionClient``. This change requires splitting
Nova's related requests and the others(authentication, volume...), which
are still require "project_id" at the url.

It is a complex task, which can be skipped for now to unblock
implementation of further microversions.

Change-Id: Ia6e608aac41d2f2d59b9504d21647e4f88af3335
2016-02-10 19:04:08 +00:00
Jenkins
1ed747c20d Merge "Fix running functional tests against deployment with insecure SSL" 2016-02-10 13:45:08 +00:00
Jenkins
3da2728ce6 Merge "Make _poll_for_status more user-friendly" 2016-02-09 15:04:08 +00:00
Jenkins
b0fcc4efdd Merge "Updated from global requirements" 2016-02-08 17:27:46 +00:00
Vincent Untz
e378d32353 Fix running functional tests against deployment with insecure SSL
Change-Id: I106d571e7ddeaeaa1de1ffeff3e88e1eb6898032
2016-02-08 17:51:47 +01:00
OpenStack Proposal Bot
6634c72cda Updated from global requirements
Change-Id: Iacadd617dff797b26acc355bcdcaa11979ed1589
2016-02-08 02:43:58 +00:00
Andrey Kurilin
0d0749d39f Make _poll_for_status more user-friendly
NOTE: _poll_for_status is a private method, which is used only in shell
      module, so we can modify it without backward compatibility.

_poll_for_status is used for various resources with different interfaces.

In case of snapshotting, it works with Image resources, which doesn't have
"fault" attribute in "error" state. To prevent AttributeError, we should take
this into account.

Also, an exception raised by _poll_for_status(InstanceInErrorState) should
not be hardcoded for one type of resource, so this exception is renamed to
ResourceInErrorState. An exception InstanceInDeletedState, which is also
can be raised by _poll_for_status, is not modified, since I don't know cases
when it can be used with resources other than Server.

Change-Id: Ie0ee96999376cbf608caa1cf8521dbef5c939b52
Closes-Bug: #1538073
2016-02-04 20:06:43 +02:00
Cao Shufeng
ba39fd3caa Fix omission of request_ids returned to user
The subclass of ManagerWithFind implements get() function, and all
the get() functions returns an object with request_ids. Let's expose
these request_ids to users directly.

Change-Id: Icb3c480c637c39412ed085f4523fb93e36fea0a7
Closes-Bug: 1541694
2016-02-04 08:22:00 +00:00
Jenkins
0927de6c8e Merge "Remove unnecessary filter from Resource's __repr__() function" 2016-02-03 23:12:45 +00:00
Cao Shufeng
2131f777eb Remove unnecessary filter from Resource's __repr__() function
'request_ids' is a function of class RequestIdMixin.
Resource().__dict__.keys() doesn't contains a function. So it not
necessary to filter it.

Change-Id: I73af5d1be39769f70cbe4c1ec83144d56f94f91a
2016-02-03 09:29:58 +08:00
Jenkins
3baed9ed48 Merge "Use # noqa to ignore one line but not whole file" 2016-02-02 12:17:03 +00:00
Jenkins
3c934b0455 Merge "Support to boot a VM with network name" 2016-02-02 12:04:10 +00:00
Jenkins
ec64db5e21 Merge "Add release notes for return-request-id-to-caller" 2016-02-02 00:43:38 +00:00
Jenkins
145eeb11c7 Merge "Update translation setup" 2016-02-01 22:37:03 +00:00
Bo Wang
0105fd1206 Use # noqa to ignore one line but not whole file
"# flake8: noqa" option disables all checks for the whole file.
To disable one line we should use "# noqa".

Closes Bug: #1540254

Change-Id: I34c8a2218f974cd7e78c60e9c1fec26751c4e82d
2016-02-02 01:03:06 +08:00
Takashi NATSUME
96c5c93f64 Add release notes for return-request-id-to-caller
Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I5e66448036cfcb5367a6ab7af27eb765f6a2c456
Implements: blueprint return-request-id-to-caller
2016-01-29 10:20:06 +09:00
Andreas Jaeger
e808f328c2 Update translation setup
Follow new infra setup for translations, see spec
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html
for full details.

This basically renames
python-novaclient/locale/python-novaclient.pot to
novaclient/locale/novaclient. For this we need to update
setup.cfg. The domain name is already correct in
novaclient/i18n.py.

The project has no translations currently, let's remove the outdated
pot file, the updated scripts work without them. So, we can just
delete the file and once there are translations, an updated pot file
together with translations can be imported automatically.


Change-Id: Ifeabedf157f0338c1e76dc5ab8ab41e2e331ad87
2016-01-28 14:12:20 +00:00
Takashi NATSUME
209f172242 Add return-request-id-to-caller function(5/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/volume_snapshots.py
* novaclient/v2/volumes.py
* novaclient/v2/volume_types.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I4de8c5cf685a5970acc92f8a58a1db26a8d9ffc7
Implements: blueprint return-request-id-to-caller
2016-01-28 11:24:03 +00:00
Takashi NATSUME
9f10d7d0b0 Add return-request-id-to-caller function(4/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/contrib/assisted_volume_snapshots.py
* novaclient/v2/contrib/baremetal.py
* novaclient/v2/contrib/cells.py
* novaclient/v2/contrib/instance_action.py
* novaclient/v2/contrib/list_extensions.py
* novaclient/v2/contrib/migrations.py
* novaclient/v2/contrib/server_external_events.py
* novaclient/v2/contrib/tenant_networks.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I58ec61eb585d145cb7d638bcb690b3ebee0461e9
Implements: blueprint return-request-id-to-caller
2016-01-28 11:23:36 +00:00
Takashi NATSUME
0414bab3d3 Add return-request-id-to-caller function(3/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/keypairs.py
* novaclient/v2/limits.py
* novaclient/v2/networks.py
* novaclient/v2/quota_classes.py
* novaclient/v2/quotas.py
* novaclient/v2/security_group_default_rules.py
* novaclient/v2/security_group_rules.py
* novaclient/v2/security_groups.py
* novaclient/v2/server_groups.py
* novaclient/v2/services.py
* novaclient/v2/usage.py
* novaclient/v2/versions.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I9203f70a0eef5686b590fbff35563f2cf8b6f586
Implements: blueprint return-request-id-to-caller
2016-01-28 11:22:00 +00:00
Jenkins
0799238648 Merge "Add return-request-id-to-caller function(2/5)" 2016-01-28 11:10:16 +00:00
Jenkins
1d08e65195 Merge "Add return-request-id-to-caller function(1/5)" 2016-01-28 10:49:26 +00:00
Jenkins
8cf8edde26 Merge "Add wrapper classes for return-request-id-to-caller" 2016-01-28 10:49:05 +00:00
Jenkins
f2fb37f189 Merge "Functional tests for os-services" 2016-01-27 20:56:25 +00:00
Pavel Kholkin
15d7b403bb Support to boot a VM with network name
Bug_description:
Today, in order to specify networking arguments, the nova client
only accept uuid's. It would be nice if we could extend the
client option to allow names to be accepted too.

Solution:
This patch supports provisioning of VM by mentioning network name.
_boot method currently validates for network ID to boot a VM.

Updates:
* new parameter 'net-name' is added
* when 'net-name' is specified network ID is retrieved
* network ID is used for further processing of vm boot request
* if multiple networks with the same name exist then
NoUniqueMatch exception is raised
* help text is updated

DocImpact
Closes-Bug: #1496180

Co-Authored-By: Pavel Kholkin <pkholkin@mirantis.com>

Change-Id: Ifb14a76749901ee106cdb807e38820a2c25e1320
2016-01-27 23:08:26 +03:00
Jenkins
5e4318c27e Merge "[microversions] Extend shell with 2.12" 2016-01-27 16:13:44 +00:00
Takashi NATSUME
f194a5abad Add return-request-id-to-caller function(2/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/agents.py
* novaclient/v2/aggregates.py
* novaclient/v2/availability_zones.py
* novaclient/v2/certs.py
* novaclient/v2/cloudpipe.py
* novaclient/v2/fixed_ips.py
* novaclient/v2/flavor_access.py
* novaclient/v2/flavors.py
* novaclient/v2/floating_ip_dns.py
* novaclient/v2/floating_ip_pools.py
* novaclient/v2/floating_ips_bulk.py
* novaclient/v2/floating_ips.py
* novaclient/v2/fping.py
* novaclient/v2/hosts.py
* novaclient/v2/hypervisors.py
* novaclient/v2/images.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: Ic624d532f1a468dd45105bbb5aa6d8a730984338
Implements: blueprint return-request-id-to-caller
2016-01-27 02:45:22 +00:00
Takashi NATSUME
f9aa277c62 Add return-request-id-to-caller function(1/5)
Add return-request-id-to-caller function to
'Server' resource and 'ServerManager'.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/servers.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I8c2d3abcebba7823f42e2f27356e73bc6d7ade42
Implements: blueprint return-request-id-to-caller
2016-01-27 11:44:19 +09:00
Takashi NATSUME
2220c56375 Add wrapper classes for return-request-id-to-caller
Added wrapper classes which are inherited from base data types str,
list, tuple and dict. Each of these wrapper classes and
the Resource class contain a 'request_ids' attribute
which is populated with a 'x-compute-request-id' or
a 'x-openstack-request-id' received in a header from a response body.

This change is required to return 'request_id' from
client to log request_id mappings of cross projects.

This patch is one of a series of patches for implementing
return-request-id-to-caller.

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I422c4f4ee59991ca89a0a16f548b537c8b61bb97
Implements: blueprint return-request-id-to-caller
2016-01-26 23:46:10 +00:00
Jenkins
51504e713e Merge "[microversions] Add support for 2.17" 2016-01-25 22:24:10 +00:00
Jenkins
7eb742517f Merge "Updated from global requirements" 2016-01-25 18:19:42 +00:00
Andrey Kurilin
6cbb22583b [microversions] Add support for 2.17
Description of microversion:
  Add a new API for triggering crash dump in an instance. Different operation
  systems in instance may need different configurations to trigger crash dump.

Note:
 - it is hard to write a functional test for this microversion, since it
   requires instance in error state
 - all possible failed responses already covered by novaclient.exceptions

Nova's change: I6ed777ff637254b4b79417008f9055dd19fc7405

Change-Id: If03b1864bbe7074c720b946fc2700bd5d07debc3
2016-01-25 14:24:49 +02:00
Jenkins
5619354b81 Merge "Remove argparse from requirements" 2016-01-25 02:38:13 +00:00
jichenjc
6791a8be69 Allow restore command with name param
when we try to restore an instance, it's already deleted state,
so we need to add 'delete=True' as default to restore command,
otherwise, the search function can't find the instance
whose state is deleted with the given name

Change-Id: I81cdc46897d76333452069a691824264ad504518
Closes-Bug: 1534644
2016-01-23 22:06:48 +08:00
OpenStack Proposal Bot
ca4e838aad Updated from global requirements
Change-Id: Ib1a5293498921aed5e42c14aa7a64878166419d7
2016-01-23 10:35:52 +00:00
Andrey Kurilin
a54a1d16db [microversions] Extend shell with 2.12
Shell was not extended in original patch[1], which turned on v2.12, since
there was not any support of vif in shell yet.
Since shell entry point for legacy vif was merged[2], we need to add support
for v2.12 in shell too.

[1] - I18cf23847d3b2b01f5a6ffae2ebc4bede54babce
[2] - Ib3078125beb7beaa08a3408486db54e0d10763e6

Change-Id: Ie38d099b2babfd8424c7d15bd3dfe8bd75e51136
2016-01-22 20:26:54 +02:00
Jenkins
44edba9e1c Merge "Added support for Nova microversion 2.16" 2016-01-21 17:23:06 +00:00
Jenkins
8165c771ae Merge "[microversions] Add support for 2.15" 2016-01-21 17:22:59 +00:00
Jenkins
1cf3fa9d77 Merge "[microversions] Add support for 2.14" 2016-01-21 17:22:53 +00:00
Jenkins
1e7310a74d Merge "Fix URLs for CLI Reference and API" 2016-01-21 17:10:34 +00:00
Jenkins
c1aaf4431b Merge "Functional tests for flavors with public and non-public access" 2016-01-21 13:06:04 +00:00
Andreas Jaeger
60b05f7128 Remove argparse from requirements
argparse was external in python 2.6 but not anymore, remove it from
requirements.

This should help with pip 8.0 that gets confused in this situation.
Installation of the external argparse is not needed.

Change-Id: Ib7e74912b36c1b5ccb514e31fac35efeff57378d
2016-01-20 19:21:40 +01:00
Tomi Juvonen
48605fcb43 Added support for Nova microversion 2.16
Added support for new host_status attribute in endpoints
servers/detail and servers/{server_id}.

Partially implements blueprint get-valid-server-state

Change-Id: If72fbcaa02267077dc082a7557c593f35474c4bb
2016-01-19 15:31:22 +00:00