2542 Commits

Author SHA1 Message Date
xiexs
dceb77ff44 Clean the duplicated columns for "nova network-list"
If we specify --fields with default columns name, then there will
be an additional column which is absolutely redundant, we need to
check for such case.

Also do the same for "nova list"

Co-Authored-By: ZhiQiang Fan <aji.zqfan@gmail.com>

Change-Id: Ife0a62d2d77aee261ce39c30d3a89ba97a253dae
Closes-Bug: #1574424
2016-04-29 05:53:02 +08:00
ZhiQiang Fan
c22cbb6fac [Trivial] change some functions in novaclient/utils.py to public
There are some functions in novaclient/utils.py which have name with
prefix `_`, in Python, this means it is a private function which
should be only used in its own module. However, these functions are
used in other modules such as novaclient/v2/shell.py.

This patch removes the prefix _ for these functions.

Change-Id: I7bc8a76fd390a7dd30eecbb5c7e641b6ccfb40c0
2016-04-27 20:13:45 +08:00
Jenkins
3bed5446d7 Merge "Use common find_server from v2.shell" 2016-04-26 00:48:31 +00:00
Jenkins
ed645a7618 Merge "Add a note message for reboot" 2016-04-25 17:39:00 +00:00
xiexs
2b9310eaed Add a note message for reboot
Currently nova reboot only performs a hard-reboot to
baremetal nodes as ironic doesn't support the soft-reboot
yet. And as absence of this information, end user has to try
to excute this command firstly and then probably realize
the difference between the baremetal nodes and ordinary
VM instance about this command:

 * For VM instance
   nova reboot       : perform a soft reboot by default.
   nova reboot --hard: perform a hard reboot.

 * For baremetal node
   nova reboot       : perform a hard reboot by default.
   nova reboot --hard: perform a hard reboot as well.

For more user-friendly, we'd better add some notes into
the help message explicitly.

Change-Id: I7b3f6da4b5f8a514c6d923f3546470d9de459003
Partial-Bug: #1485416
2016-04-23 20:29:48 -04:00
Jenkins
445dadcaae Merge "Restrict positional arguments for Client" 2016-04-24 00:13:11 +00:00
Gleb Stepanov
a47850b093 Decorate FakeHTTPClient with versions
Remove api_version check from get_servers_1234_migrations method
and substitute it by api_version.wraps decorator.

Change-Id: Iea780ae92bece4e2013778485d244123251e9dcc
2016-04-22 18:32:10 +03:00
Andrey Kurilin
2a72b86cd1 Restrict positional arguments for Client
It is hard to deprecate or remove arguments for Client objects. We already
have several args which are not used anywhere and we need to do something
with them(clean code).

Change-Id: I2218ff0c750922a105d21a13e42f193ffd86ec01
2016-04-19 12:39:12 +03:00
Andrey Kurilin
fd23ff9000 Use common find_server from v2.shell
- extend v2.shell._find_server with raise_if_notfound param
- reuse v2.shell._find_server for instance_action extension
- fix instance-action-list on v2.21 (it was unable to work
  with deleted instances)

Change-Id: I7b538124c6ab0ee00164822b324aaf2d37c8c2af
2016-04-14 12:05:57 +03:00
OpenStack Proposal Bot
f6efc861b7 Updated from global requirements
Change-Id: I9bf801b449d32cb8b354aa010a67737f91d000b7
2016-04-14 02:38:15 +00:00
Jenkins
d00a473238 Merge "Deprecate image list/show/delete/update CLIs/APIs" 2016-04-13 16:02:17 +00:00
Matt Riedemann
a602e59806 Deprecate image list/show/delete/update CLIs/APIs
This deprecates all of the image CLIs/python API bindings that use
the Nova os-images API which is a proxy to the Glance v1 API.

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 15.0.0 'O' release.

Depends-On: Iff5fb3180855de7adb3399f6be16bedc8543b4ec

Change-Id: I3f60cc7f4c6e27861c4a84b925d573f35f1a1848
2016-04-12 11:57:57 -04:00
Andrey Kurilin
d133a664ae Make functional tests work with v3 keystone
This patch adds support of v3 keystone to novaclient's functional tests.

Closes-Bug: 1568527

Change-Id: Iff5fb3180855de7adb3399f6be16bedc8543b4ec
2016-04-12 17:24:41 +03:00
OpenStack Proposal Bot
77f214bdbd Updated from global requirements
Change-Id: I1a150011a588bde5f0bf77c3f4383b4cfbbf5fe1
2016-04-08 00:33:13 +00:00
Jenkins
85eb9f7236 Merge "Fix typos in docstrings and comments" 2016-04-07 13:18:42 +00:00
Jenkins
c1f975f4ff Merge "Remove busted baremetal CLIs and API bindings" 2016-04-06 12:49:57 +00:00
Jenkins
96e4449f44 Merge "Switch to 2.1 default api_version in v2.Client" 2016-04-06 12:22:32 +00:00
Dao Cong Tien
a967e40185 Fix typos in docstrings and comments
Change-Id: Ib94c2b999f8295ec526d4e44883b86ab8b5a0688
2016-04-06 09:36:28 +07:00
Matt Riedemann
0634a38cdc Remove busted baremetal CLIs and API bindings
The os-baremetal-nodes compute API does not proxy
baremetal node create/delete or interface add/remove
requests to Ironic, so there is no point in even
having CLIs or python bindings for these operations
in the client.

There isn't a point in deprecating these since they
are already unusable, so let's just remove them.

Change-Id: Id5dd7fbddff87e506460904e352713ae777a8073
Closes-Bug: #1566535
2016-04-05 17:32:20 -04:00
OpenStack Proposal Bot
41fccc3828 Updated from global requirements
Change-Id: I0cc4f0d0f4d01ad0c73043f99495a525defde397
2016-04-05 13:33:33 +00:00
Jenkins
9d9cb2a0aa Merge "Fix ServerGroup.NAME_ATTR" 2016-04-05 10:50:09 +00:00
Jenkins
4b57352a54 Merge "[tests] initialize client objects inside setUp" 2016-04-04 17:30:19 +00:00
Jenkins
0193797fcf Merge "Remove deprecated volume(snapshot) commands/bindings" 2016-04-04 17:30:08 +00:00
Jenkins
7897740f28 Merge "Add default values for domain related options" 2016-04-04 14:55:41 +00:00
Jenkins
4435207af2 Merge "Using glance 'image-list'/'image-show' in boot help message" 2016-04-04 12:10:19 +00:00
Andrey Kurilin
e458fab8ef Add default values for domain related options
Keystone V3 requires that the options os_user_domain_id/os_user_domain_name
and os_project_domain_id/os_project_domain_name be set. These options do not
have default values and novaclient will fail if they are not set by user.

This patch adds default values for os_project_domain_id and
os_user_domain_id in case of Keystone V3 env.
This is consistent with what the OpenStack CLI does.

Also, two functional tests are added to check authentication via
Keystone V2 and V3.

Partial-Bug: #1522402

Change-Id: Ieb41a7fbf24107f7250ef34218604fba96531195
2016-04-04 10:57:41 +00:00
Matt Riedemann
a425702689 Remove deprecated volume(snapshot) commands/bindings
23f13437dd64496fcbc138bbaa9b0ac615a3cf23 deprecated the
purely volume or volume-snapshot related CLIs and python
API bindings during Kilo. python-cinderclient should be
used for the python API bindings now, and python-openstackclient
should be used for the CLI for those operations.

The alternate_service_type context manager is also removed
since it was only used for proxying through to the volume API
endpoint.

Since the proxy for creating volumes is removed, we have to
add python-cinderclient for testing the volume attachment
CLIs/APIs that are left intact.

Change-Id: I09a6501603667350f49b1b1fa130353a6d5272a2
2016-04-03 14:05:05 -04:00
Andrey Kurilin
b9807c0648 Switch to 2.1 default api_version in v2.Client
Direct initialization of versioned clients is restricted, but we tries to
decrease the number of possible bugs and issues, so default value for
api_version was added to v2.Client .

Let's set it to 2.1, since 2.0 is too old API version.

Change-Id: If127f858f7f670a090a57267f46a69ea4c056cce
2016-04-01 19:25:44 +03:00
Andrey Kurilin
7d8db71964 [tests] initialize client objects inside setUp
All tests from contrib dir inizialize fakeclient at module level.
It is bad practice and we should do preparatory steps at setUp method.

Change-Id: I2dd2988cd015d1dfb576fe004cb9461b02b55db3
2016-04-01 19:23:33 +03:00
Rui Chen
51306fc4c9 Fix ServerGroup.NAME_ATTR
Finding by specify server group name failed in ServerGroupsManager.find(),
ServerGroup.NAME_ATTR is "server_group_name" currently, but NAME_ATTR
should be "name", because only "name" attribute exists in ServerGroup
object, not "server_group_name".

Change-Id: Id6b7676d14e6283d856a069da5ff287dc3228386
Closes-Bug: #1563301
2016-04-01 10:02:11 +00:00
Jenkins
8c204ac1a2 Merge "Handle error response for webob>=1.6.0" 2016-03-30 12:59:24 +00:00
Jenkins
d9e8e364e0 Merge "Fix host-evacuate-live for 2.25 microversion" 2016-03-29 19:52:22 +00:00
Jenkins
c3884691a0 Merge "Removed unused Oslo Incubator code" 2016-03-29 14:34:25 +00:00
huangtianhua
31c9e399f2 Using glance 'image-list'/'image-show' in boot help message
Using glance commands instead in boot help message.

Change-Id: I0f20d24a9ab32a80bbbc524e1b5ce754aded1814
2016-03-28 17:40:19 +08:00
Jenkins
6aea33c79f Merge "Adding tox support for bandit" 2016-03-25 19:24:53 +00:00
Jenkins
5f6d731f93 Merge "aggregate-details changed to aggregate-show" 2016-03-25 19:03:50 +00:00
Matt Riedemann
90fbbb2956 Fix host-evacuate-live for 2.25 microversion
Change I01b22593724616bc0a7793c509ecabf095d6927d made the
live_migrate() method in the ServerManager conditional on the
API version requested. This broke the host-evacuate-live
command which is calling ServerManager.live_migrate() directly
with one too many arguments for the v2.25 version of the method.

This updates the host-evacuate-live shell to behave like the
live-migration method and be aware of the API version when
calling the live_migrate() method.

Related to blueprint making-live-migration-api-friendly

Change-Id: I4dbeb6ebe03f03799b706be2d787d21484b5c664
Closes-Bug: #1561938
2016-03-25 14:00:59 -04:00
Matt Riedemann
92bbae6d09 Use keystoneclient python bindings for testing
The keystone CLI has been deprecated for a long time
in favor of python-openstackclient and
Icbe15814bc4faf33f513f9654440068795eae807 finally removes
the CLI from python-keystoneclient. This will be in the 3.0
release of python-keystoneclient.

tempest-lib is using the keystone CLI and the novaclient
functional tests are using tempest-lib (which is also
deprecated now).

This change removes the usage of the keystone CLI from
python-keystoneclient via tempest-lib and replaces it
with simply using the keystone v2 python bindings from
the client.

Change-Id: I557acefbf363304ce24ac81566bb651cbfe09176
2016-03-23 20:12:59 -04:00
Ronald Bradford
7e7e5525d2 Removed unused Oslo Incubator code
This is part of graduating projects to using Oslo Libraries.
As this code is not actually used, it is simply removed.

Change-Id: Ib28a957d9a4622064ec5da2ae616ac6f0716bcbf
2016-03-22 18:31:21 -04:00
Christopher J Schaefer
c5272b349b Adding tox support for bandit
Bandit is a code linter which is used to help identify potential
security vulnerabilities. As part of the plan to integrate bandit
into each OpenStack project, support for a tox testenv is step one.
Later, gate tests will also be incorporated.

Change-Id: Ib6ef0a3e8f32f2724314c166d7de50d591c0e949
2016-03-22 16:39:11 -05:00
Jenkins
abe6707d26 Merge "Wrap interface_list by proper resource class" 2016-03-21 14:22:34 +00:00
Jenkins
2d353f2879 Merge "Overwrite Usage class's get() function" 2016-03-21 14:03:12 +00:00
Jenkins
a4d2d0ce83 Merge "Add changes-since support when list servers" 2016-03-21 14:03:06 +00:00
Jenkins
b154a4828b Merge "Validate shutdown value of --block-device" 2016-03-21 13:59:48 +00:00
abhishek.talwar
bf68a0cf10 aggregate-details changed to aggregate-show
To show details of aggregate, we have
aggregate-details command. But all other
commands to show details of any resource
is *-show like flavor-show, keypair-show etc.

So changed the command to aggregate-show.

Change-Id: If4875833a27382a6f3193ec55d6d4cb1852249fd
Closes-Bug: #1552646
2016-03-21 12:44:16 +05:30
Matt Riedemann
fa377e7fca Handle error response for webob>=1.6.0
WebOb change https://github.com/Pylons/webob/pull/230 changed
the way in which the error response body is formatted such that
it's no longer a nested dict. So we have to handle both the
old convention of an error message key to the response body error
dict and the new way with just the error body dict.

This was reported upstream:

https://github.com/Pylons/webob/issues/235

But given this was apparently implemented as a long-overdue change
in WebOb the behavior is not likely to change.

Change-Id: If653a247d842786d2824b4b3a5c0cde1383ed7ab
Closes-Bug: #1559072
2016-03-18 19:22:03 -04:00
Balazs Gibizer
f6bcac4772 Validate shutdown value of --block-device
The shutdown value of the --block-device parameter was stated to
to be either 'remove' or 'preserve' but the code only coverted
everything to False that was not equal to 'remove'.

This patch adds strict validation that rejects values other than
'remove' or 'preserve'.

Closes-bug: #1558157
Change-Id: I89a6c4fe90ec4d8155f4a7b93006d1972654a223
2016-03-16 17:51:00 +01:00
Kevin_Zheng
7cefdd36a6 Add changes-since support when list servers
Nova API supports change-since filter when list servers:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L325-L331
but in python-novaclient we don't.
This patch  add the support for change-since when list servers.

Closes-bug: #1551591

depends-on: Ic2f239f634f917a5771b0401a5073546c710c036

Change-Id: I27f2d1e33a56d357e247111b338c93861716cfee
2016-03-16 17:56:21 +08:00
Doug Hellmann
a7bffe8a71 Update reno for stable/mitaka
Change-Id: I9081add2d40865a4e379de4ed7dfc46c5e69fbbc
2016-03-10 21:13:40 +00:00
Jenkins
b921cb14e4 Merge "Prepare to move extension into core plugin" 2016-03-10 13:54:55 +00:00