Use osc-lib directly for exceptions.
Leave openstackclient.common.exceptions for deprecation period.
Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
It is perfectly valid for a Cinder volume to have a volume_type of
"none", so don't make the Image API v2 require that one be set.
Change-Id: I1a6da8d791fa0ae67cac46eec81bcbcb420729c3
Closes-Bug: #1559344
Users could specify the last image (name or ID) of the previous page with
--marker option to control the start image of the output.
Change-Id: Idca0235ee83b1226b00c89cf3d38500fa898b7d0
Closes-Bug: #1540988
This option is quite useful if there are too many images.
Change-Id: If6a901c27c5da2d1f4412e8fa9ba3bed3b72fdd9
Co-Authored-By: Tang Chen <chen.tang@easystack.cn>
Partial-Bug: #1540988
Since --page-size has never worked, there is no paginate logic needs
to be implemented in "image list" command. So remove the unnecessary
loop.
And also, the marker is not necessary because --marker option has not
been implemented. Will add it back when implementing --marker option.
Change-Id: I71fea1502f92f447a49697edb52e8e82f336772f
Partial-Bug: #1540988
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.
This commit calls a logger in the base class and
drops all logging definition from individual commands.
Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
* image create and image set now use --project to specify an alternate
project to own the image
* --owner is still silently accepted but deprecated, add warning messages
* --project and --owner are mutually exclusive to prevent precedence issues
Closes Bug: 1527833
Change-Id: Iccb1a1d9175ef9b5edcd79d294607db12641c1f0
This change allows admins to deactivate and reactivate their
images. Currently this has to be done with the REST api or the
glanceclient.
This change introduces `--deactivate` and `--activate` for the `image
set` command.
This requires glanceclient 1.2.0. Which got bumped here:
https://review.openstack.org/#/c/257512/
Change-Id: I476c44a0343cdc92d58ddc93fb06470242de2345
Depends-On: I2c370c6bf6ff664d94d756cc76aaa983fbdb8869
Closes-Bug: 1516661
Actually, the status column is useful for the user.
So, it`s better to output this info by default (or, user had
to specify the extra option, i.e. --long).
Change-Id: Id2a9f86f0de5310f8f5ff9a46bf1b7411094b519
Closes-Bug: #1519181
This was previously part of the command, so added it in for backwards
compatibility. This adds the --volume command and the complimentary
--force command allowing users to create images from volumes.
It seems it may not be possible to add it to image set v2.
Change-Id: Ica36e70989f75d80959af3227f66708758fae68d
This adds --owner to `image create`. This is backwards compatable with v1.
Change-Id: I9e79cf880c91a1386419db729818d23dfe632179
Depends-On: I8d572a070bbb04dccdd051b8e0ad199c5754746e
image_member doesn't have a _info attribute, glanceclient returns
warlock object instead of a Resource object.
Change-Id: If6e7c4bd404454bd6cbe8c111879c1afa1380211
Closes-Bug: #1509054
the rest of OSC set commands do not show the resource after it has
been updated. unless the update fails then we report back a failure,
otherwise the user should assume everything went fine.
Change-Id: I2bd4188450c3853b4a1bc25f80fc9450cda32bdd
This adds --tag to the v2 version of `image set`. This
is another step to compatability between the osc image api.
Added merge of tags into existing tags and handling duplicates,
and tests for same.
Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>
Change-Id: Ie800fcbf8bbc0978c54ace3278750a18023e8ce4
Make the Image v2 image set command meet at the intersection of the v1
image set command and the v2 image create command:
* Add visibility to the deadopts list and remove the option
* Put the options in the same order as v1 image set
* Make the help text match
* Add --properties
* Move the additional options that do not appear in either v1 image set or
v2 image create after --property as they are really pre-defined properties
* Add tests for v2 image set to match v1 and then some
* Put the SetImage class in v2/image.py in alphabetical order
Change-Id: I102b914e8ad09a014f6fdd846c5766b6c2eaadb8
Currently `image set` uses the new api, where other parts of osc the old
api is used. This deprecates the v2 api in favour of the v1 to maintain
the same commands across osc. However the functionality now remains
there as people could now be using this functionality.
This also adds the --unprotected argument, as in the previous version if
--protected was not supplied it would just make the argument
--unprotected without the users explicit consent.
The patch also fixes the documentation for image set as it was outdated.
Change-Id: I990d20332c80165102badef7ac94ddbeb7824950
Closes-Bug: 1498092
This currently breaks listing images with --long. Tags are an
array and shouldn't be formatted as a dictionary.
Change-Id: I6d1d85351b58ae4824498774673ebdc8eaa7e420
Closes-Bug: #1498150
Currently, these properties are each top level keys, they should
all be under a single 'properties' field. Secondly, the tags are
kept as an array, but can be shown as a comma separated string.
Change-Id: Ic769c657a86e768fee38acc40434c377de70a7bc
We have it for v1, but v2 is the future. There are two differences,
things in v2 do not go into a properties dict, and the actual image
data needs to get uploaded as a second step.
Closes-Bug: 1405562
Co-Authored-By: Niall Bunting <niall.bunting@hp.com>
Co-Authored-By: Sean Perry <sean.perry@hp.com>
Change-Id: If7b81c4a6746c8a1eb0302c96e045fb0f457d67b
image show using V2 api was failing.
openstack --os-image-api-version 2 image show <image_id>
ERROR: openstack _info
Closes-Bug: #1450829
Change-Id: Ic95db2f63d9f5f37e29f0d7e048397da311fbf8c
Handle the paginatiion for image list. We were sorting the
data here, so nothing lost for the generator.
Change-Id: I2d7d4b3d5c9f650953f309c971ac53b64f6f7f77
Add sort support to image list by sorting items in the client side.
The parameter syntax follows this spec[1].
[1] https://review.openstack.org/#/c/145544/
Change-Id: I42b487d18f00f937db1938daa46487cea2a896ab
Closes-Bug: #1410251
* Hides previously broken --page-size option
* Adds --property to image list for filtering on properties
* Adds Visibility, Protected, Owner, Properties/Tags to --long output
* Adds api.utils.simple_filter() for selecting matches out of a list
of objects
* Adds tests for all of the above
* Updates image docs
There are additional filtering options to be added in later reviews.
Change-Id: I32feff0ad61aae749b33621c817658d7dc90c3aa
Closes-bug: 1401902
image list for v1 and v2:
* Add --public|--private to command parsers
* Implement local public/private filtering for v1 image_list()
* Pass public/private filter to server for v2 image_list()
Change-Id: Ie7c24ea2d1bf2b3b1b7fa342eb45fee45894634d
This is part1, add support for these objects:
compute.server
imagev1.image
imagev2.image
network.network
volume.volume
volume.backup
volume.snapshot
Closes-Bug: #1400597
Change-Id: Ice21fee85203a8a55417e0ead8b509b8fd6705c1
The current tests for image do not run v2 image code, changing
that portion also made it's only test fail.
I opted to change the image delete code and not the test, since
passing the object ID is more in line with the rest of the
project code.
Change-Id: I62e13c063a5d68279dbbf31e59266db6285d73bf
Add disk_format, container_format, size and status to image list
command. Added tests as well.
Change-Id: I8e3822c6d46d0020fc706955c026549f6c635587
Closes-Bug: #1348475
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
* Add v1 versions of image delete, list, save, set, show
* Change default Image API to v1
Rebased for https://review.openstack.org/#/c/36772/
Change-Id: Ie2bfe660aac8a0fcf651c67fd1ea4842e76ce377
As discussed in https://review.openstack.org/#/c/36352/ for each
command, we were setting api = identity or volume... etc,
this was for an old way of calling commands that are is no longer
used.
Also removed openstackclient/common/command.py
Change-Id: I2705f35d343f2ae729dc22d6aed0b852b2f8ca19
We use the V1 API for `create` since it does not
yet exist in the V2 API in glanceclient.
For blueprint glance-client.
Change-Id: Ifa819c14f6a013f4530d16247a671e5a1c740a28