Refactoring code: Making dicts to use single instruction: pop()
rather than two instructions: get() and del, giving the codes
a format that carries through.
TrivialFix
Change-Id: Ie404888ccf257978e0ac491165926dfde9a3e6d6
Beckup-restore does not currently accept the name of the backup,
however other backup actions do and according to its description
backup-restore should as well.
Change-Id: I26d8d2f1fe6cf7362d23d9b9668936dbb0509251
Closes-Bug: #1604892
Following the commit fb2c434c2461a25193067104de766fc1142a6024 in
the cinder repo the --force option to upload-to-image is ignored
by default. To enable it the config option enable_force_upload
must be set to true.
The help text for upload-to-image in the python cinderclient
should remind user that --force may not work in some cloud now.
Closes-Bug: #1611667
Change-Id: Ib56fb2016d933a9bbbcb0185c50e33d2166b34e6
Request-id log is recorded in SessionClient.request() method,
but None is used as logger, that causes all the v1 commands
to be broken. This patch fixes the issue and updates the related
unit tests.
Change-Id: I46b973f2baca8d7402a39e0d15dbd8da38f4e590
Closes-Bug: #1616070
Manager's api_version property is used by api_version.wraps. It
should not be an "empty" class and the real api_version can be
read from Client class.
The 3.0 version's upload-to-image doesn't work as excepted because
of this useless api_version of VolumeManager class. This patch also
fix it and update some unit tests for it, because the changes are
co-dependent on one another.
Co-Authored-By: Nate Potter <nathaniel.potter@intel.com>
Change-Id: I398cbd02b61f30918a427291d1d3ae00435e0f4c
Closes-Bug: #1573414
Closes-Bug: #1589040
Now, "cinder help subcommand" can not show whether an argument
is supported for a specific microversion.
With this change, developers only need to add a start_version or
end_version in the utils.arg wrap, cinderclient will support
the microversion for that arguement.
@utils.arg(
'--foo',
start_version='3.1')
@utils.arg(
'--bar',
start_version='3.2',
end_version='3.5')
def do_some_action():
......
In previous example, an exception will be raised for such command:
$ cinder --os-volume-api-version 3.6 --bar some-ation
And only "--foo" will show up for such help command:
$ cinder --os-volume-api-version 3.1 help some-ation
Change-Id: I74137486992846bbf9fdff53c009851db2356eef
Partial-Bug: #1600567
Co-Authored-By: Nate Potter <nathaniel.potter@intel.com>
Positive tests for the cinder CLI commands which check actions with
volume create command like create volume from snapshot,
create volume from volume.
Change-Id: I77912d413ac061eb8376233dfef772c55265d135
'six' is an independent third party module so it doesn't
need to be imported and used from oslo_utils.strutils.
TrivialFix
Change-Id: Icb3232bb1ebae0e8332e66c5806474d7f9dfd6df
The help for the 'api-version' command should state that
it is displaying the api-version info for the server, not the
client:
Display the server API version information.
Change-Id: Ia4380871ddca1b7ff41a5e6c8cf86488626e69fc
Currently with '--debug' option any cinder command only logs the
request from keystoneauth and not the main cinder service request.
Added keystoneauth logger to self.ks_logger so that logs can be
logged as expected.
Closes-Bug: #1606814
Change-Id: I7193aa6f43cb3186c49fc409b6e1ce7a36f596f9
cinderclient was assuming an identity v2 styled service catalog
would always be returned (when using `cinder endpoints`).
keystoneclient would return either a v2 or v3 styled catalog,
whereas keystoneauth abstracts out the differences and handles
them internally. the result is that there is no need to look
for specific ['serviceCatalog'] or ['catalog'] keys in the
dictionary returned from keystoneauth.
it should be noted that perhaps cinderclient should deprecate
the ability to list endpoints since that is mostly an identity
and admin level operation, and likely an artifact from early
openstack days, it should now be handled by openstackclient.
further, it's not clear whether the command is meant to list all
endpoints or just the endpoints in the user's token (which it does
now).
Change-Id: Ibfcccedee5baf43f5b5c517d37e3f046c8743078
Closes-Bug: 1608166
Cinder API allows specifying tenant_id to get tenant
specific resource usage. This was missing in the client.
This fix should allow fetching tenant specific resource usage
directly from the client. Added tenant argument to the limits CLI.
Closes-Bug: #1580562
Change-Id: I3fbd6341f6d018a79e7c343107ac974b6fbb9239
Edited do_backup_restore function to accept the name of the backup
as well as its id. Changed the test to comply with this.
DocImpact
Closes-Bug: #1604892
Change-Id: Iaec69dd053a119366fa5a8437701a6f7c3da2235
move cinderclient to keystoneauth as keystoneclient's auth session,
plugins and adapter code has been deprecated.
Co-Authored-By: Paulo Ewerton <pauloewerton@lsd.ufcg.edu.br>
Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: Jamie Lennox <jamielennox@gmail.com>
Change-Id: Id4bf0e2088e8ad99e83cd4f9b8549c2aca1f65a2
Cinder currently has the ability to take over the management of
existing volumes and snapshots ("manage existing") and to relinquish
management of volumes and snapshots ("unmanage"). The API to manage an
existing volume takes a reference, which is a driver-specific string
that is used to identify the volume on the storage backend. This
patch adds the client code for APIs for listing volumes and snapshots
available for management to make this flow more user-friendly.
Change-Id: Icd81a77294d9190ac6dbaa7e7d35e4dedf45e49f
Implements: blueprint list-manage-existing
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).
While this works it is not very pythonic, since you have to write
expressions such as:
if not min_version and not max_version:
return True
elif ((min_version and max_version) and
max_version.is_null() and min_version.is_null()):
return True
This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.
So previous code would just look like:
if not min_version and not max_version:
return True
Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.
Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d