45 Commits

Author SHA1 Message Date
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
Tang Chen
9c62af8a42 Make set/unset commands in compute/image/common return normally when nothing specified
After this patch, all set/unset commands will return normally
when nothing specified.

Change-Id: Id94d0329faa1a674006a9aae901f834b41917317
Close-bug: #1588588
2016-06-21 15:15:18 +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
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
Xiaoyang Zhang
6c8e0dc1df Fix i18n support for help and log.warning in image
Change-Id: I6e2764aaf4b8c0efa78872646a7b3482ba044dc8
2016-05-19 20:34:46 +08:00
Tang Chen
61c1d985c7 Fix return value of "image set" command
"image set" command should return None. But in one path,
it returns ({}, {}). This patch fixes this.

Change-Id: I3847e661cb7e89863921a3f0a859d9b1a8077ede
2016-02-29 16:18:55 +08:00
Brandon Palm
f49f0fead2 Fixed a bunch of spacing
Nothing too complicated here.  I fixed a bunch of spacing issues
that I saw in OSC.

Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
2016-02-23 10:38:58 -06: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
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
Tang Chen
f552302b61 Trivial: Remove useless return from files in image and volume
Change-Id: I3526ecd202d0908d91305a066ad72d03cee794b5
2015-12-18 23:25:05 +08: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
Jenkins
9f23f1f13f Merge "image set should not show the resource" 2015-10-08 20:38:05 +00: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
1afd8f62cd Image fix bug with --volume
Currently after calling the cinderclient to create an image from a volume,
it also then tries to create another image. This fails as the keyword
volume is unexpected. This add checks so the image is not created in
this case. Allowing --volume to not throw an error when it has worked.

Change-Id: I67e650eb0b8c331d86515e3e326c39a5d6dad5e1
Closes-Bug: 1497221
2015-09-18 15:29:47 +00:00
Jenkins
d80deaba41 Merge "Move update code from image create command" 2015-07-02 14:08:05 +00:00
Marek Aufart
bd589778c2 Move update code from image create command
Openstack image create command updates existing image (with same name) by
default. That might be confusing since glance allows create multiple
images with same names and may lead to unwanted image update by image
create command.

Image update code was moved from image create action to image set action.

BackwardsIncompatibleImpact

Change-Id: I1686c6544c366262efab9e33c066d5f8a667f707
Closes-Bug: #1461817
2015-07-02 11:02:17 +02:00
TerryHowe
ce65164155 Add functional tests for image set
This patch includes functional tests for image set and it includes
a change to use the OSC utils.format_dict method to format the
properties.  This will give a more user friendly format to the image
commands and it gives a more consistent testable format to the
output.  Instead of:

{u'a': u'b', u'c': u'd'}

The user will see:

a=b, c=d

Change-Id: Ib396316586ffc5dbab231064d5b6dc9425507934
2015-06-16 12:34:00 +00:00
Amey Bhide
ba21d463de Add missing properties to image set command
Enable user to update the following image properties from OSC:
container-format, disk-format, size

Closes-Bug: #1446362
Change-Id: Id9f40f15702e8f14f0327a37fcc7d7971338c258
2015-05-25 22:49:55 -07:00
Lin Yang
af2a665a63 Fix tiny typo in comment message
compatability => compatibility

Change-Id: I3181fb2b83df1e2cb60a9eedf319f2ad0a487dba
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
2015-04-30 17:21:45 +08:00
Jenkins
e288e0194c Merge "Handle the pagination for image list" 2015-04-20 20:35:02 +00:00
TerryHowe
3c7b5185ca Handle the pagination for image list
Handle the paginatiion for image list.  We were sorting the
data here, so nothing lost for the generator.

Change-Id: I2d7d4b3d5c9f650953f309c971ac53b64f6f7f77
2015-04-20 11:23:15 -06:00
Marek Aufart
d363068617 Fix skipped image create attribute location attr
Image create action accepts attribute called location,
in method body is list of allowed attributes, which contain
localtion, what is typo and this attribute was not passed to
glance. Fixed.

Change-Id: I357b06b63b8aa97f7a5f587ef3fcee7a4b360ed1
Closes-Bug: #1445460
2015-04-17 14:20:37 +02:00
zhiyuan_cai
42cff38834 Add sort support to image list
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
2015-02-06 10:57:10 +08:00
Dean Troyer
61a40343fd Add filter to image list
* 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
2015-01-27 19:17:35 -06:00
Dean Troyer
1ecf1bee2d Begin low-level API for Image v1 and v2
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
2015-01-20 17:01:23 -06:00
Steve Martinelli
0d7a50d384 Command doc: image
Change-Id: Ib1563b58351315dc2a44ad77882f8c834a1214c0
2015-01-09 00:16:21 -05:00
wanghong
470b7e53a8 add multi-delete support for compute/image/net/volume
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
2014-12-23 09:31:10 +08:00
Dean Troyer
ca783f4659 Close files on image create
The file opened for --file was never closed.  Close it if it is a
file object.

Change-Id: I7bd120a2413de42339771d01e8fd1894d38c3011
2014-10-14 15:37:23 -05:00
Steve Martinelli
c8b3f23733 Change help text for image save command
Change-Id: Ib2aecb68ffa06f9ac831131944c98c49cf99c75a
Closes-Bug: #1372070
2014-09-21 12:02:11 -04:00
Steve Martinelli
e1c32b8224 Add more columns to image list output
Add disk_format, container_format, size and status to image list
command. Added tests as well.

Change-Id: I8e3822c6d46d0020fc706955c026549f6c635587
Closes-Bug: #1348475
2014-07-25 01:09:59 -04:00
Dean Troyer
6380b8b959 Image create and set command updates and tests
Refactor image create and set commands to properly handle properties.
This is particularly tricky with exclusive booleans as in this case leaving
both choices off the command line should NOT assume a default value but
leave the existing value unchanged.

Properties were not being updated correctly in the 'image set' command.
Refactor it to use the same pattern as in other SetXxx commands.
Add tests for arg handling.

Change-Id: I123a64c9b4feecab25a3e2013cc047f55b1c9967
2014-06-16 23:30:46 -04:00
Christian Berendt
3b485de6b0 replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
2014-05-20 13:49:56 +02:00
Terry Howe
e6e0dbf754 Add --volume option to image create command
Add ability to create an image from a volume.
* Added --volume command to image create
* Added --force option to image create
* Added block to access volume manager in image create
* Tests added for the volume option

Change-Id: I3910a2b5e04acd0d15dd230747ba6ebca07aa316
Closes-Bug: #1207615
2014-03-05 11:26:13 -07:00
Alexander Ignatov
ad4367839f Remove copyright from empty files
According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.

Change-Id: Iba09a00f24dfbd1cd03c1c9f70ea216788e64d93
Closes-Bug: #1262424
2014-01-20 17:28:13 +04:00
Jenkins
a53ed797b7 Merge "Fix image set properties error" 2014-01-10 17:27:50 +00:00
Dean Troyer
9e31f8ea14 Fix errant underscores
Change-Id: I71b8c8df14b85e3042220e3593a9732ee6cefe15
2014-01-09 16:54:40 -06:00
Dean Troyer
7b999d786c Fix image set properties error
Change-Id: Ia290935c8a040221caf1a46ca29a7bb2e5df1ce6
2014-01-06 09:42:40 -06:00
Dean Troyer
6460f1eb35 Complete basic test infrastructure
This finally gets all of the API tests into a common framework regarding
test classes and so forth.

Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c
2013-11-18 22:11:10 -06:00
Dean Troyer
7d138b94ec Remove tenant round 3 - other commands
Mostly options and help strings:
* image, server, project usage, volume

Change-Id: I788b0660f8c2daacde53c20a72dd1afc60cf5159
2013-07-31 10:12:20 -05:00
Dean Troyer
cdaee1b71e Complete Image v1
* 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
2013-07-18 14:14:14 -05:00
Steve Martinelli
1a0d5ccc68 Remove api = apiName calls from each method
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
2013-07-12 11:07:33 -05:00
Josh Kearney
a2e3a16221 Rename all instances of 'metadata' to 'property'.
Change-Id: I454cbe685dc5afa0a09ecc976a90d6eb6bc57d14
2013-05-07 11:18:38 -05:00
Josh Kearney
6da61e03f0 Adds image create and delete functionality.
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
2013-04-23 14:09:20 -05:00