75 Commits

Author SHA1 Message Date
David Rabel
4ea4f6fabb openstack image create : --file and --volume exclude each other
Added parser.add_mutually_exclusive_group() for --file and --volume
in openstack image create.

Change-Id: I4d9fc6314801d569354e5644e231ddd6c7f1853d
Closes-Bug: 1666551
2017-02-24 08:50:37 +01:00
Brian Rosmaita
80c62021c8 Update container format choices
The choices for valid container formats is out of date in the
image v1 and v2 help text.  This patch adds 'ova' and 'docker'
and does some minor refactoring to align the container_format
option with the disk_format option.

Change-Id: Icdea5fab801abd651baf45cf96c920c7df79f11b
Closes-bug: #1658138
2017-01-23 23:04:49 -05:00
Jordan Pittier
f055fe67c1 Add support for Glance 'update image members' feature
This patch adds 3 new options to the "image set" command: --accept,
--reject and --pending. This updates the membership status for
an image.

Closes-Bug: 1620481
Change-Id: I13b8c067aad68ece9ff636fbdd83bcb3663c91b2
2017-01-04 19:26:01 +01:00
Mikhail Feoktistov
63377f25fc Add ploop to supported disk formats
This format is used for containers for Virtuozzo hypervisor

Closes-Bug: 1650342

Change-Id: Ic79f29a1fe9ea5016d3d5520c2b06e39da01ff61
2016-12-15 12:46:55 -05:00
Jenkins
fdf93e04e6 Merge "Revert "Remove marker and loop from "image list" command"" 2016-12-05 22:21:47 +00:00
Steve Martinelli
42f33435ed Revert "Remove marker and loop from "image list" command"
This reverts commit 0b6fdcbe4c3f3142fdd18bfd827653d894607941.

Adapt "image list" to not loop when --marker is specified on command
line.

Update tests to work with current state of code.

Change-Id: I8af58adf8637a9e34371c6280db40935d22bc3c3
2016-12-05 10:35:00 +01:00
Jenkins
7078502ea6 Merge "Sort list images by name by default" 2016-12-02 18:50:17 +00:00
Steve Martinelli
f15352f861 clean up image choices and help text
Use choices for image set and image create commands, this aligns
with our use of choices in networking commands.

Also update the help text to match that of the networking
commands, where we iterate through the options.

Related-Bug: 1635518
Change-Id: Ib4c66b06e07f1d4e5bfe1b74053f2215cccad890
2016-11-23 22:52:33 +05:30
Vijendra Soni
a7a0d0c61a Sort list images by name by default
Set the default key and dir for openstack image list,
if no command line argument passed
Changing sort_key to name(old value: created_at)

Change-Id: I6c61f6e5a04824d655ccf43477afcec9652101df
Closes-Bug: #1639231
2016-11-21 20:19:53 +05:30
Steve Martinelli
0ef8535036 translate all command help strings
Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.

This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.

Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
2016-11-17 02:33:42 +00:00
SongmingYan
1b878b4efd Remove execute permission on a few files
Some files have execute permission unnecessarily. Change them from
755 to 644.

Change-Id: I471ebd1c3d123ad4a7376f7f5996f53f8c2d9b0b
2016-07-22 17:38:34 +00:00
Marc Abramowitz
8bbf30498e image list: Add Checksum column
The checksum could potentially be useful for spotting duplicated images or
checking if images with the same name are identical or different.

Closes-Bug: #1602073

Change-Id: Ia0c41970c846d550de14297e18bc738e847e5a3b
2016-07-11 20:31:13 -07:00
qinchunhua
6f36385cb8 Correct reraising of exception
When an exception was caught and rethrown,
it should call 'raise' without any arguments
because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
2016-07-07 15:05:58 +00:00
liyifeng
a4dd1fc714 Make the print info support i18n
When OSC failed to set a image's property, it will print
the image name and status, which is an useful info to
users. So translate this massage, and record it in log.

Change-Id: Icdff4dab17dedcb40289700c4cd278e6e62eea25
2016-06-21 13:52:51 +08:00
Tang Chen
047cb68493 Standardize logger usage
Use file logger for all command specific logs.

This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html

After this patch, all self.log and self.app.log
will be standardized to LOG().

NOTE: In shell.py, we got the log in class OpenStackShell,
      which is also known as self.app.log in other classes.
      This logger is used to record non-command-specific logs.
      So we leave it as-is.

Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
2016-06-20 15:16:51 +00:00
Jenkins
1464c8a237 Merge "Make set/unset command in identity and image pass normally when nothing specified" 2016-06-17 06:24:35 +00:00
sunyajing
8a12a39ece Make set/unset command in identity and image pass normally when nothing specified
Also update its unit tests.

Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059
Partial-bug: #1588588
2016-06-17 04:20:28 +00:00
Jenkins
5b36898b2b Merge "Fix image delete multiple arguments error" 2016-06-14 07:26:58 +00:00
Dean Troyer
9e2b8e6730 osc-lib: command
Leave command.py and test_command.py as a sanity check during the
deprecation period.

Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
2016-06-13 11:00:22 -05:00
Dean Troyer
be192676bd osc-lib: parseractions
Leave parseractions.py and test_parseractions.py as a sanity check during the
deprecation period.

Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
2016-06-13 10:55:44 -05:00
Dean Troyer
e5e29a8fef osc-lib: utils
Use osc-lib directly for utils.

Leave openstackclient.common.utils for deprecation period.

Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
2016-06-13 10:50:44 -05:00
Dean Troyer
d20c863ebc osc-lib: exceptions
Use osc-lib directly for exceptions.

Leave openstackclient.common.exceptions for deprecation period.

Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
2016-06-13 10:50:01 -05:00
sunyajing
8c7e34d65c Fix image delete multiple arguments error
Fix image delete command, support processing multiple arguments
delete error.
Fix doc/source/command-errors.rst, make the msg format correct.

Change-Id: Icbe347fe077bc148bf71ea8f7399b0e934b7cdf9
Partially-Implements: blueprint multi-argument-image
2016-06-13 16:15:01 +08:00
zheng yin
2c965b88f6 fix image unset
modify "target" to "tagret"

Change-Id: I80674b23804b26430aed13b5e6c6dc2b240771cd
2016-06-06 11:09:25 +08:00
sunyajing
3e11661074 Add "image unset" command
This patch add a command that supports
unsetting image tags and properties

Change-Id: I6f2cf45a61ff89da6664f3a34ae49fdd85d8c986
Closes-Bug:#1582968
2016-05-28 16:38:22 +08:00
Xiaoyang Zhang
6c8e0dc1df Fix i18n support for help and log.warning in image
Change-Id: I6e2764aaf4b8c0efa78872646a7b3482ba044dc8
2016-05-19 20:34:46 +08:00
Nicolas Simonds
1d1c7a0631 Image API v2: make volume_type optional
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
2016-03-18 16:08:30 -07:00
Tang Chen
499369329c Add --marker option to "image list" command
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
2016-02-03 14:04:50 +08:00
xiexs
5812803865 Add limit option to "image list" command
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
2016-02-03 13:42:57 +08:00
Tang Chen
0b6fdcbe4c Remove marker and loop from "image list" command
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
2016-02-03 13:42:49 +08:00
Akihiro Motoki
258c1102cc log take_action parameters in a single place
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
2016-02-02 09:58:32 +09:00
Jenkins
fe10d0faf4 Merge "Initialize activation status" 2016-01-21 22:36:15 +00:00
Terry Howe
4d4368bb26 Initialize activation status
activation_status throws an exception if the image set fails
because it is not initialized.

Change-Id: Iff6d5a8844eed954fb1c0bcea96118b99ac6bcf4
2016-01-19 16:15:59 -07:00
Dean Troyer
cf2de9af79 Change --owner to --project in image commands
* 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
2016-01-15 09:24:48 -06:00
xiexs
0a444fc949 Add owner validation for "openstack image create/set"
Owner validation is necessary if a new image owner
will be created/set.

Change-Id: I621774e02866bfa98a31b613deff5d7b6a962737
Closes-Bug: #1517134
2015-12-21 11:17:42 -06:00
NiallBunting
b3943d7142 Add image re/deactivate commands
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
2015-12-16 14:25:41 +00:00
Jenkins
a207c27fc8 Merge "Add --volume to Image create" 2015-12-04 10:36:45 +00:00
xiexs
342fd158e9 Add status column for "openstack image list"
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
2015-11-29 20:37:40 -05:00
NiallBunting
a7ecec2a50 Add --volume to Image create
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
2015-11-20 17:22:07 +00:00
Jenkins
62b5865dce Merge "Add --owner to image create" 2015-11-12 00:03:14 +00:00
NiallBunting
5ad59968ac Add --owner to image create
This adds --owner to `image create`. This is backwards compatable with v1.

Change-Id: I9e79cf880c91a1386419db729818d23dfe632179
Depends-On: I8d572a070bbb04dccdd051b8e0ad199c5754746e
2015-11-06 10:43:08 +00:00
lin-hua-cheng
12668b3dab Fix issue when displaying image_member
image_member doesn't have a _info attribute, glanceclient returns
warlock object instead of a Resource object.

Change-Id: If6e7c4bd404454bd6cbe8c111879c1afa1380211
Closes-Bug: #1509054
2015-10-23 00:15:19 -07:00
Steve Martinelli
2bd82ab892 image set should not show the resource
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
2015-10-06 20:14:54 +00:00
NiallBunting
1afb574533 Add tags to image set
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
2015-10-06 20:14:34 +00:00
Dean Troyer
201b1cee86 Clean up Image v2 image set command
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
2015-10-06 11:11:59 -07:00
Jenkins
c71c78df92 Merge "Glance image set Resolve Fracturing" 2015-09-23 12:28:02 +00:00
NiallBunting
8faabb3bba Glance image set Resolve Fracturing
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
2015-09-23 00:31:41 -04:00
Jenkins
d0427808b8 Merge "Use format_list instead of format_dict when listing images" 2015-09-21 21:54:26 +00:00
Steve Martinelli
e0e9b2bfae Use format_list instead of format_dict when listing images
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
2015-09-21 15:18:36 -04:00
Steve Martinelli
d8f7527ff2 Format an images properties and tags
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
2015-09-21 18:53:01 +00:00