939 Commits

Author SHA1 Message Date
Yuriy Nesenenko
f8eef18297 Cinder client should retry with Retry-After value
If a request fails but the response contains a "Retry-After",
the cinder client should wait the amount of time and then retry.
Cinder client should report a warning to user and continue with
retry, so that user can cancel the operation if not interested
in retry. The value in "Retry-After" header will be in seconds
or GMT value, client should handle both the cases.

How many times client should retry will be controlled by user
through "--retries" argument to cinder api example,
$ cinder --retries 3 availability-zone-list

If request was not sucessful within the retries, client should
raise the exception.

Change-Id: I99af957bfbbe3a202b148dc2fcafdd20b5d7cda0
Partial-Bug: #1263069
2016-07-06 11:42:20 +03:00
Jenkins
0a92c9fb19 Merge "base.Resource not define __ne__() built-in function" 2016-07-05 10:47:53 +00:00
yuyafei
ccde9b3ba7 base.Resource not define __ne__() built-in function
Class base.Resource defines __eq__() built-in function, but does
not define __ne__() built-in function, so self.assertEqual works
but self.assertNotEqual does not work at all in this test case in
python2. This patch fixes it by defining __ne__() built-in function
of class base.Resource. Also fixes spelling errors:resoruces.

Change-Id: I845d531880ad74d928a3e15335ed10e71590826e
Closes-Bug: #1586268
2016-07-04 07:15:11 +00:00
Abhishek Kekane
679cdd2451 Log request-id for each api call
Added new private method to log request-id of each api call
for both SessionClient and HTTPClient. Already available
ks_logger and client_logger will be used for SessionClient
and HTTPClient respectively.

Change-Id: I679c57b96071ecd9bcd1ab2ed50692195586ca52
Implements: blueprint log-request-id
2016-06-28 08:44:23 +00:00
Jenkins
d123164f30 Merge "Add strict Boolean checking" 2016-06-27 17:05:59 +00:00
xiexs
e5e0a7ee49 Add strict Boolean checking
Because of lack of strict boolean checking, the unexpected
'False' value will always be send to server if invalid bool
value is specifed.
For instance:
  the parameter 'is-public' of cinder type-update,
  the parameter 'force' of cinder qos-delete
as so forth.

This patch tries to add a strict checking for them
to prevent invalid bool value.

Change-Id: I896ddbb6ec4760bfd4d721db960138e2df0b86e1
Closes-Bug: #1596418
2016-06-27 08:41:11 -04:00
SongmingYan
060e87438f Delete mox in cinderclient
Since we are no longer using mox in cinderclient,
delete it in "openstack/common/__init__.py".

Change-Id: Ia06d18aa20f239a2244fb64f6cc1ac3c8d66e24b
closes-Bug: #1595032
2016-06-27 10:46:28 +00:00
xiexs
f0f8e6b5ab Fix Service.__repr__ to remove the undefined attribute
The self.name is undefined in the Service class.
And also there is no need any unique information to
identify this object, so we just remove it directly.

Change-Id: I3ce8663f830357855f2155e080393ea97f8f80ba
Partial-Bug: #1585024
2016-06-25 11:45:38 -04:00
Jenkins
6cadb738b8 Merge "Fix Capabilities.__repr__ to remove the undefined attribute" 2016-06-24 22:52:04 +00:00
Jenkins
63b3087c57 Merge "Fixing parsing problem of cascade in client" 2016-06-24 22:51:49 +00:00
xiexs
0bf56a0a54 Fix Capabilities.__repr__ to remove the undefined attribute
The self.name is undefined in the Capabilities class.
And also there is no need any unique information to
identify this object, so we just remove it directly.

Change-Id: I0b821345c0d4c9a4636b9d097b9a66ba59768092
Partial-Bug: #1585024
2016-06-22 11:46:57 +00:00
bhagyashris
42d2a33fb4 Fix python 2,3 compatibility issue with six
ConfigParser is available in python2 but not in python3.
ref:http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html

Change-Id: Icf47e18c31a6fabf3584aead054ebd4c669a2574
2016-06-21 20:14:26 +05:30
wanghao
86fe5617aa Fixing parsing problem of cascade in client
We have implemented cascade deleting volume in CLI now,
but there's still something that should be improved:

1. A parsing problem of cascade is existing that always
evaluate parameter to True.

So now change the cascade parameter to a flag that don't
accept value anymore.

If user want to delete volume with snapshot, just need to
use 'cinder delete --cascade [volume_id]'.

Change-Id: I92e9400d5d7fbb741607bdbde7ac0c0667fca85d
Closes-Bug: #1585441
Implements: blueprint support-deleting-vols-with-snps-in-cli
2016-06-16 07:20:58 +00:00
Jenkins
835747d40f Merge "Fix argument order for assertEqual to (expected, observed)" 2016-06-14 15:39:48 +00:00
reedip
ea2693b9d9 Fix argument order for assertEqual to (expected, observed)
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit
Tests fail. The following patch fixes this issue.

TrivialFix

Change-Id: I817a654733e0f3886ca85778a49aa579592f60ff
Closes-Bug: #1259292
2016-06-14 08:27:32 +00:00
Jenkins
c95539753d Merge "Make dict.keys() PY3 compatible" 2016-06-07 16:57:18 +00:00
Jenkins
b734a1b0ed Merge "Fix the incorrect alignment" 2016-06-06 15:02:16 +00:00
Jenkins
884ee24a9b Merge "Updated from global requirements" 2016-06-06 09:33:31 +00:00
Jenkins
e813b973ac Merge "Replace assertTrue(isinstance()) by optimal assert" 2016-06-06 07:18:57 +00:00
Jenkins
47cedfe9c3 Merge "Make __repr__ print encryption_id for VolumeEncryptionType class" 2016-06-06 04:05:57 +00:00
OpenStack Proposal Bot
2d0ee7a217 Updated from global requirements
Change-Id: I867998073730aa92ed7223cfe9dcf27f946b7f45
2016-06-02 21:11:06 +00:00
Jenkins
3d06d358ad Merge "Support for snapshot force delete" 2016-06-02 19:44:24 +00:00
OpenStack Proposal Bot
dab1359dd0 Updated from global requirements
Change-Id: I9fe18e40bd6ffbd34916ea4062d8a0e9d0edfe10
2016-06-01 13:53:44 +00:00
Victor Stinner
623cef2d5c Don't enable lazy translation when loading client
The change I9c8db9487b554b637a41620c858a7e7abf802879 introduced a
regression in nova and trove. Importing cinderclient.client now calls
_i18n.enable_lazy() which calls oslo_i18n.enable_lazy(). It's wrong to
modify a global variable (oslo_i18n._lazy.USE_LAZY) when a module is
imported.

This change removes the call to _i18n.enable_lazy() from client.py.

Closes-Bug: #1587071
Related-Bug: 1586976
Change-Id: I1512b86815e7248fa226c6969124ddc654145562
2016-05-30 17:14:15 +02:00
Sheel Rana
699a2f5dce Support for snapshot force delete
Cinder snapshot force delete is supported from cinder server
side but cinderclient support is not present.

This patchset adds support for cinder snapshot force delete
from cinderclient side.

Closes-Bug:#1418353

Change-Id: I8c4f02f9c3b855d44b1a3c7da7083d87b3b70da9
Implements: Blueprint snapshot-backup-force-delete
2016-05-29 08:53:28 +00:00
xiexs
906c9986a7 Make __repr__ print encryption_id for VolumeEncryptionType class
The self.name attribute is undefined in the VolumeEncryptionType
class. Instead we should print the self.encryption_id attribute
in the __repr__().

Change-Id: Ic11b45069145bbae078c8175928c5dd869bd8cb8
Partial-Bug: #1585024
2016-05-27 07:24:52 -04:00
Jenkins
df81163fce Merge "Remove deprecated tempest_lib and use tempest.lib" 2016-05-25 21:49:40 +00:00
Jenkins
1aa45d8474 Merge "Support for cinder backup force delete" 2016-05-23 19:30:08 +00:00
Sheel Rana
11010ec9eb Support for cinder backup force delete
Cinder backup force delete is supported from cinder server
side but cinderclient support is not present.

This patchset adds support for cinder backup force delete
from cinderclient side.

Closes-Bug:#1567243

Partially-Implements: blueprint snapshot-backup-force-delete

Change-Id: I4ec38376d57ef6f74fefdd3bd2fea7a10bc51672
2016-05-21 12:30:18 +00:00
Ivan Kolodyazhny
9e19357e4b Fix upload_to_image method
Commit Ie639179c5bbbaca4de62b42b368830afcfd8f7ac introduced 'visibility'
and 'protected' params. These params should be used only with
v3.1 microversion. Also these changes break current v2 users.

This patch fixes these issues.

Closes-Bug: #1584056
Change-Id: I0574631791c475bbefdb6e7d1647a20d0759df64
2016-05-20 22:55:55 +03:00
wanghao
af91c23a45 Remove deprecated tempest_lib and use tempest.lib
Since 10.0.0 release tempest-ib is deprecated now.
Cinderclient should use tempest.lib in test code
and add tempest>=11.0.0 in requirements following
global-requirements.

Closes-Bug: #1583583
Change-Id: I9d766f46eb6fff29ae9c0267a60ff2ef4bf2343e
2016-05-20 21:13:07 +08:00
xiexs
6e54ec81fe Fix the incorrect alignment
The "aligns" attribute no longer exists in the Prettytable,
"align" instead. So we should use "align" attribute to force
the output with left alignment by default.

Change-Id: I97b30216000b6e31c1bef614cf0b0d68ab8cfb08
Closes-Bug: #1583880
2016-05-19 23:25:36 -04:00
xiexs
219c334f01 Make dict.keys() PY3 compatible
The dict.keys()[0] will raise a TypeError in PY3,
as dict.keys() doesn't return a list any more in PY3
but a view of list.

Change-Id: Ia6c0783ca8c8514a06defbeed0fa9ef24bbd9d4a
Closes-Bug: #1583419
2016-05-19 00:11:56 -04:00
Jenkins
0cdcfb5988 Merge "Updated from global requirements" 2016-05-18 23:18:32 +00:00
OpenStack Proposal Bot
e992c00962 Updated from global requirements
Change-Id: I299ff1546179c71664b43e8e821b9e45b9a2fe73
2016-05-18 20:27:13 +00:00
Mitsuhiro Tanino
729b8f8474 Don't reset volume status when resetting migration status
In case of failed volume migration, status of the volume is
still in-use and the migration status is set to error.

Current reset-migration-status command resets not only
migration status but also volume status. However the volume
status should not reset because the volume is still attached.

Closes-Bug #1552058
Change-Id: I9a8a5ed6a00bdcffecbf98862fe60aee373f5e9b
2016-05-18 15:43:54 -04:00
Jenkins
a4109cc3bf Merge "Support --os-key option" 2016-05-18 14:46:23 +00:00
Jenkins
9f3c8952a1 Merge "Add options when uploading images to Glance" 2016-05-17 22:46:38 +00:00
Cedric Brandily
80d3edc71e Support --os-key option
Currently we can specify a client certificate key using --os-key option
inherited from keystoneclient cli options but it has no effect because
keystoneclient Session expects as cert argument, one of the followings:
 * None (no client certificate),
 * a path to client certificate,
 * a tuple with client certificate/key paths.

The change updates cinderclient code to support the last case (ie:
os_cert and os_key are non-empty) in order to take into --os-key option
and OS_KEY environment variable.

Closes-Bug: #1564646
Change-Id: I258fd554ad2d6a5413ffe778acefa3a0b83e591f
2016-05-17 15:02:00 +02:00
Jenkins
d07b424bed Merge "Change api_version to self.api_version" 2016-05-11 13:44:15 +00:00
Jenkins
b2d58a8e13 Merge "Remove Python 2.5 compat shim" 2016-05-11 13:03:50 +00:00
scottda
030dedf9e8 Change api_version to self.api_version
Call to _construct_http_client uses:
api_version=api_version
but should be:
api_version=self.api_version

Change-Id: If2686461bff1ef9afd318e999c9e517e15b1677f
Closes-Bug: 1580319
2016-05-10 14:44:28 -06:00
Jenkins
5044a2fff3 Merge "Updated from global requirements" 2016-05-09 20:12:50 +00:00
OpenStack Proposal Bot
111fbe2e7a Updated from global requirements
Change-Id: I0c2d5ae4869fc1f00cf6e041ad840cef0da90a65
2016-05-06 22:22:05 +00:00
Eric Harney
dfefde11e1 Remove Python 2.5 compat shim
We don't support or test with Python 2.5.

Change-Id: Id29f0cee786205cc751d2d5bc031b3c105ae6aaa
2016-04-21 14:34:34 -04:00
Nathaniel Potter
7590fe4b7d Add options when uploading images to Glance
Added --visibility and --protected options
when uploading volumes to the image service.

DocImpact

Change-Id: Ie639179c5bbbaca4de62b42b368830afcfd8f7ac
Closes-Bug: #1288131
Depends-On: I6e6b2276af22b7809ea88289427c6873211b3faf
Signed-off-by: Nathaniel Potter <nathaniel.potter@intel.com>
2016-04-21 17:51:43 +00:00
Eric Harney
2f00cf8857 Only print volume ID in migration messages
This displays the volume id rather than <Volume: id>.

Change-Id: Iff4096a86d0fd403ee1b56d76ec78e879eee331b
Closes-Bug: #1573094
2016-04-21 11:42:36 -04:00
Jenkins
8d79acda0f Merge "Use six.moves.urllib.parse urlencode" 2016-04-21 13:38:39 +00:00
Jenkins
86580971f7 Merge "Add docs for running tests" 2016-04-21 08:37:57 +00:00
scott
a11aef839e Add docs for running tests
Add documents for running unit and functional tests.

Change-Id: I4616193dade844c5a774dd74aa1805452fd01a9e
Closes-Bug: #1560615
2016-04-20 10:54:13 -06:00