1177 Commits

Author SHA1 Message Date
Zuul
95e51505e1 Merge "Backup create is not available from 3.0 to 3.42" 2017-12-15 05:42:04 +00:00
pooja jadhav
2a478b3528 Removed unnecessary parameters from group and group_snapshots create APIs
As per code, the 'status', 'user_id' and 'project_id' parameter
is not required to be passed in the request body in case of group
and group_snapshot create APIs. Even if you pass these parameter,
it is silently ignored in the code.

This patch removes those parameters passed in the request body.

Change-Id: I29e7d4c8a3eee52f4ea7278d2edf2c7deec40628
2017-12-14 11:23:12 +05:30
TommyLike
9bfd6da08d Backup create is not available from 3.0 to 3.42
Backup create command is shielded by patch [1].

[1]: 2255fc99da9752737dcaa96ae4507b646074afb2

Change-Id: I100b8734ee2df4d81e16e2bfdafd81227c20d25e
2017-12-14 11:17:29 +08:00
lihaijing
d59eb3ee05 Fix the way to get backup metadata
In v3/shell.py do_backup_update(), the metadata through
'args.metadata' is a list, like this: 'metadata': [u'k1=v1'].
But we need a metadata dict like this: 'metadata': {"k1": "v1"}.
So call the right method shell_utils.extract_metadata()
to get metadata from args.

Change-Id: I82cb96b1f89b4009d4b3f4a0e64db076a7a04977
2017-12-13 16:53:28 +08:00
Zuul
440f8d82aa Merge "Remove 'end_version' parameter in backup update" 2017-12-11 11:08:51 +00:00
John Griffith
76fe6fc01d Bump Max API version to 3.48
In order for Nova to be able to make use of the code
for shared_targets that has gone into Cinder we need to
bump to API Version to 3.48.

This bumps to 3.48 to match the latest add to the Cinder side:
    https://review.openstack.org/#/c/524697/1

Change-Id: Icaa17654bd2810098d02f8074fedb35c5221cd55
2017-12-07 14:46:56 -06:00
TommyLike
7aedf4c898 Support create volume from backup in client
This patch adds create volume from backup support
in cinderclient.

Change-Id: I01dbcf6b113d88732c174b848be2127ee7242b3c
Implements: blueprint support-create-volume-from-backup
Depends-On: 58d0fb327f9fc980e0c8b84dcd9f64c093285d13
2017-12-07 11:31:39 +08:00
TommyLike
d8b6d8020e Bump Max version to 3.46
Bump max version in client directly as
the client changes are not needed.

1. 3.46: support create bootable volume from nova
         0 size image.

Change-Id: Ib0cf2d88e55006c10b873327ccc85dca2dd09769
2017-12-07 08:41:00 +08:00
TommyLike
a0b18d22a4 Support list with 'with_count' in client
Add 'with_count' parameter in list
volume, snapshot and backup APIs.

Change-Id: I2b7b41b3579c24703a7a67ab5dc6f960a3ccbdc2
Partial-Implements: bp add-amount-info-in-list-api
2017-12-05 01:15:19 +00:00
TommyLike
9ddce659a9 Remove 'end_version' parameter in backup update
Remove unnecessary 'end_version' which was
added in patch [1].

[1]: 2255fc99da9752737dcaa96ae4507b646074afb2

Change-Id: If014ba9c12bf662ef23ebf17decfa59273c63944
2017-12-04 09:15:41 +08:00
Zuul
d17ae43e1d Merge "Add cluster support in migration and manage" 2017-12-01 15:10:06 +00:00
Zuul
3c98861ed8 Merge "Revert "Bump MAX version of client to 3.45"" 2017-11-28 17:51:12 +00:00
Zuul
86240a5316 Merge "Remove unused attribute when updating quota_class" 2017-11-02 07:56:21 +00:00
Sean McGinnis
17fb13fd68 Revert "Bump MAX version of client to 3.45"
3.45 has landed, but it's not the expected change.

This reverts commit 664299b235be69ae35670d96fb70e62836b9b5b0.

Change-Id: I39e93c6078871f8652889cf8a46c1af6962288e4
2017-10-30 17:47:53 +00:00
Zuul
d65ad9e3cb Merge "Bump MAX version of client to 3.45" 2017-10-29 22:59:21 +00:00
Zuul
a8364340dd Merge "Fix OS_AUTH_TYPE env var usage" 2017-10-19 02:12:06 +00:00
Nam Nguyen Hoai
679e2f2e10 Use generic user for both zuul v2 and v3
Zuul v2 uses 'jenkins' as user, but Zuul v3 uses 'zuul'.
Using $USER solves it for both cases.

Change-Id: I7bd4c3d5a0acc2c73557a65dcc274a97f16bfd07
2017-10-17 07:22:49 +00:00
Jenkins
2dbf22112f Merge "Correct sphinx source code syntax" 2017-10-10 02:41:35 +00:00
Jenkins
d345ab236c Merge "Add api_version_wraps to attachment-complete" 2017-10-08 16:14:16 +00:00
Gorka Eguileor
45eb51eb99 Add service cleanup command
Cinder volume services will perform cleanup on start, but when we have
multiple volume services grouped in a cluster, we may want to trigger
cleanup of services that are down.

This patch adds command `work-cleanup` to trigger server cleanups and
prints service nodes that will be cleaned and those that didn't have an
alternative service in the cluster to do the cleanup.

This command will only work on servers supporting API version 3.24 or
higher.

New command:

cinder work-cleanup [--cluster <cluster-name>] [--host <hostname>]
                    [--binary <binary>]
                    [--is-up <True|true|False|false>]
                    [--disabled <True|true|False|false>]
                    [--resource-id <resource-id>]
                    [--resource-type <Volume|Snapshot>]

Specs: https://specs.openstack.org/openstack/cinder-specs/specs/newton/ha-aa-cleanup.html

Change-Id: I1c33ffbffcb14f34ee2bda9042e706937b1147d7
Depends-On: If336b6569b171846954ed6eb73f5a4314c6c7e2e
Implements: blueprint cinder-volume-active-active-support
2017-10-03 11:03:28 +02:00
Gorka Eguileor
1a4176ad87 Add cluster support in manage listings
This patch adds support for API microversion 3.17, which allows us to
pass --cluster optional argument to volume and snapshot manage listings.

Implements: blueprint cinder-volume-active-active-support
Change-Id: I97b5f2e9960d5a1f140fc638804dbc631d63ff9d
2017-10-03 11:03:28 +02:00
Gorka Eguileor
8fce74056f Add cluster support in migration and manage
This patch adds support for API microversion 3.16, which allows us to
pass --cluster optional argument to migration and manage operations.

For this, a new type of CLI argument is added, the mutually exclusive
arguments that can be used similarly to the utils.arg decorator, but
with utils.exclusive_arg decorator.

Implements: blueprint cinder-volume-active-active-support
Change-Id: If004715b9887d2a0f9fc630b44d6e11a4a8b778d
2017-10-03 11:03:28 +02:00
Eric Fried
571e5d8c4d Let keystoneauth set the microversion header
Constructing the Adapter with the default_microversion kwarg causes the
Adapter to handle setting the appropriate Openstack-API-Version header.
With this change set, SessionClient now uses the api_version kwarg to
set default_microversion instead of setting the header explicitly.

Change-Id: I5de721fa373f5d3adb42ddb4b5598f19aabfff3b
2017-09-28 20:53:27 +00:00
j-griffith
664299b235 Bump MAX version of client to 3.45
Adding a shared_targets field to Volumes in Cinder.  This doesn't
require any changes in the client, however we do need to bump the
MAX MV support value.

Show volumes now returns two new fields that will be displayed in
the show command:
    shared_targets: <True|False>
    backend_name:  <backend-name-of-storage-device>

Change-Id: Ie1291f90756c3752de562f022126af2f6b3e0637
2017-09-26 19:17:04 +00:00
j-griffith
3d1225cbb0 Implement UserID in snapshot list response
We have a gap in the microversions implemented in the cinderclient
and the MAX version being reported by the client.

One of those is the addition of "user_id" in the snapshot list
response.  This patch adds that with the appropriate version
checking.  Note that the Max version has already been updated,
but there are a few implementations missing.

Change-Id: Ia8bdb46b46091a89996e404825466430b8906d18
Partial-Bug: #1715759
2017-09-21 10:18:58 -06:00
j-griffith
da20fbf45b Add api_version_wraps to attachment-complete
The attachment-complete method didn't include the version
checking.  This patch adds that and adds a couple of tests.

Change-Id: I63dba6ee6d56bb63a79f3ad2ef3412ebd9c1ce07
Closes-Bug: #1715732
2017-09-09 18:17:01 +00:00
j-griffith
2255fc99da Implement metadata for backup create/update
We have a gap in the micro versions implemented in the cinderclient
and the MAX version being reported by the client.

This patch addresses the missing changes for micro version 3.43
which adds support for metadata for backup create and update.

Change-Id: I14c7205784c53ec3ab0985a4460a88f59de171fb
Partial-Bug: #1715759
2017-09-09 09:30:55 -06:00
Jenkins
b372fe6927 Merge "Unsupported 'message' Exception attribute in PY3" 2017-08-29 02:32:01 +00:00
Jenkins
96dd3391a2 Merge "Fix attachment_id returned by create and show volume" 2017-08-28 22:25:02 +00:00
Steve Noyes
aab7a587b6 Fix attachment_id returned by create and show volume
The attachment_ids in the volume info returned by show volume
were incorrect. It was showing the volume_id, not the actual
attachment_id. This fix changes the attachment_ids returned by show
volume to correctly reflect the attachment_id.

Also, added a unit test for this, and added an attachment_id
to the fake volume so that other tests wouldn't now fail.

Closes-Bug: #1713082
Change-Id: I9ec36af5dd460d03d786aeeb3cc36a869c19ff62
2017-08-28 08:36:12 -04:00
liuyamin
7b601bdb2f Unsupported 'message' Exception attribute in PY3
The 'message' attribute has been deprecated and removed from Python3.
Use six.text_type(e) instead of e.message. For more details, please
check [1]:

[1] https://www.python.org/dev/peps/pep-0352/

Change-Id: Ibd4e7f5fefa6b1dfb6258c5eacfa53cd3485d22c
2017-08-28 02:35:45 +00:00
Eric Harney
74457db9ae Enable F811, F821
F811 is a little noisy with api_versions.wraps()
decorated methods, but opting to disable it in these
cases seems better than missing problems in the rest
of the code.

Change-Id: I9c46938ab2a442e55f96b5ab6c119c4475afaecd
2017-08-23 15:02:14 -04:00
Eric Harney
e3e2f4d397 Fix method/module redefinition errors
These are caught by F811, but that test is
currently disabled because it fails on
@api_versions.wraps() decorated methods.

Just clean up these errors for now.

Change-Id: I42aed024352f798ebafddeb6f12880d8726360fe
2017-08-23 14:52:58 -04:00
Jenkins
fd0a11e7d7 Merge "Enable H306" 2017-08-22 14:34:25 +00:00
TommyLike
2c05b83a8c Remove unused attribute when updating quota_class
When updating quota class, attribute 'class_name' is
neither used in the request nor the response [1].

[1]:
https://github.com/openstack/cinder/blob/master/cinder/api/contrib/quota_classes.py#L56

Change-Id: Ic1a743ce36a087f369703f10313d51b79b5cab9c
2017-08-18 15:25:30 +08:00
John Griffith
b7d3468460 Add an attachment_complete API call
The new attachment_update method in Cinder's API creates an attachment
object and populates it with the provided connector info. In addition,
we set the volumes status to in-use and update the attachment object
status to "attached".

This isn't really accurate though, because we don't know if the volume
is actually attached (connected) by the consumer or not.  Also a big
side effect here is that currently all of our tests and automation
use volume-status to determine if a volume is fully connected/ready
for use and that everything went well.  It's used as an ack in most
cases.

This change goes back to using multiple states to signify where a
an attachment is in it's life-cycle:
1. attachment_create
    We've created an empty attachment record but haven't done anything
    with it yet.
2. attachment_update
    We provided a connector and set up the TGT so that everything is
    ready for a consumer to connect/use it.
3. attachment_complete
    An ACK back from the consumer letting us know that they connected
    it successfully and are doing their thing.

It would be cool to just key all these checks of the attachment object itself,
and just use attachment_update to do so, maybe in the future?

Change-Id: I3b28d2cb89a8d81c7cdec425f355c78bfdfe3450
Related-Bug: #1710295
2017-08-14 10:27:44 -06:00
liuyamin
eb76eeead5 Correct sphinx source code syntax
Change-Id: Ia6763a019dbb89f0944d702ce78be963a7ef8271
2017-08-09 11:25:40 +08:00
Jenkins
bf749a83e2 Merge "Support skip-validation for quota update" 2017-08-08 16:34:05 +00:00
Jenkins
426c9fb8a8 Merge "Fix get_highest_client_server_version with Cinder API + uWSGI" 2017-08-04 21:19:19 +00:00
Gorka Eguileor
ce1013d6b3 Fix OS_AUTH_TYPE env var usage
Right now only deprecated OS_AUTH_SYSTEM environmental variable works to
set the authentication to noauth, the reason is that we have multiple
arguments writing on the same destination.

This patch fixes this by making both arguments have the same default
value, which is to use environmental variable OS_AUTH_TYPE if it has a
value or deprecated OS_AUTH_SYSTEM if not.

Closes-Bug: #1708687
Change-Id: I478fb0e628d4bebd4a1dc78c2559202916aa051f
2017-08-04 18:10:50 +02:00
Ivan Kolodyazhny
19bb7cdf4f Fix get_highest_client_server_version with Cinder API + uWSGI
get_highest_client_server_version should work with any endpoint type:
cinder-api with eventlet, uWSGI, etc.

This patch is based on python-novaclient patch [1]. In a future, we can
deprecate get_highest_client_server_version in flavor of keystoneauth
descovery feature.

[1] Icba858b496855e2ffd71b35168e8057b28236119

Closes-Bug: #1708188
Change-Id: I9acf6dc84c32b25bfe3254eb0f97248736498d32
2017-08-04 17:05:13 +03:00
Jenkins
6498301b37 Merge "Added missing column 'Allocated'" 2017-08-03 15:12:34 +00:00
Eric Harney
60d00b0a03 Enable H306
Enforce ordering of imports with H306.

For tests, this is mostly done by grouping test
imports after other cinderclient imports.

Change-Id: Ie40fda014d1aedb057e5b4ea1f27f999c84e6373
2017-08-01 16:23:49 -04:00
Jenkins
d7d7e50126 Merge "Clean the redundant code in shell.py" 2017-08-01 19:14:16 +00:00
TommyLike
fba4164637 Added missing column 'Allocated'
Added missing column 'Allocated' for
quota usage command.

Change-Id: Ic2656e2f849e834c7a576b0462d6e8a399a95006
2017-07-31 19:30:50 +08:00
Jenkins
130397a128 Merge "[Optimize] Adds interval and increase waiting time" 2017-07-28 10:05:03 +00:00
junboli
c6504502ed Clean the redundant code in shell.py
In the file cinderclient/shell.py, packages requests and six
are double imported. This patch is to clean the redundant code.

Change-Id: I4bade57753a50245df1b4b82c4a8708d3b0acdba
2017-07-27 10:07:05 +00:00
Jenkins
790303e7b3 Merge "Make --profile load from environment variables" 2017-07-27 04:13:59 +00:00
Tovin Seven
3e235b2b51 Make --profile load from environment variables
--profile argument can be loaded from OS_PROFILE environment variables
to avoid repeating --profile in client commands.

Co-Authored-By: Hieu LE <hieulq@vn.fujitsu.com>
Change-Id: Ia9b469024395327ec0ee082ddaea3234fc3ca5a6
2017-07-27 01:33:05 +00:00
Jenkins
63ac82a554 Merge "cinder show with attachments is a mess" 2017-07-26 22:16:39 +00:00