Merge "Added 'openstack image set --visibility'"
This commit is contained in:
commit
52af8fbc05
@ -57,7 +57,7 @@ Create/upload an image
|
|||||||
[--force]
|
[--force]
|
||||||
[--checksum <checksum>]
|
[--checksum <checksum>]
|
||||||
[--protected | --unprotected]
|
[--protected | --unprotected]
|
||||||
[--public | --private]
|
[--public | --private | --community | --shared]
|
||||||
[--property <key=value> [...] ]
|
[--property <key=value> [...] ]
|
||||||
[--tag <tag> [...] ]
|
[--tag <tag> [...] ]
|
||||||
[--project <project> [--project-domain <project-domain>]]
|
[--project <project> [--project-domain <project-domain>]]
|
||||||
@ -143,6 +143,14 @@ Create/upload an image
|
|||||||
|
|
||||||
Image is inaccessible to the public (default)
|
Image is inaccessible to the public (default)
|
||||||
|
|
||||||
|
.. option:: --community
|
||||||
|
|
||||||
|
Image is accessible to the community
|
||||||
|
|
||||||
|
.. option:: --shared
|
||||||
|
|
||||||
|
Image can be shared
|
||||||
|
|
||||||
.. option:: --property <key=value>
|
.. option:: --property <key=value>
|
||||||
|
|
||||||
Set a property on this image (repeat for multiple values)
|
Set a property on this image (repeat for multiple values)
|
||||||
@ -310,7 +318,7 @@ Set image properties
|
|||||||
[--disk-format <disk-format>]
|
[--disk-format <disk-format>]
|
||||||
[--size <size>]
|
[--size <size>]
|
||||||
[--protected | --unprotected]
|
[--protected | --unprotected]
|
||||||
[--public | --private]
|
[--public | --private | --community | --shared]
|
||||||
[--store <store>]
|
[--store <store>]
|
||||||
[--location <image-url>]
|
[--location <image-url>]
|
||||||
[--copy-from <image-url>]
|
[--copy-from <image-url>]
|
||||||
@ -376,6 +384,14 @@ Set image properties
|
|||||||
|
|
||||||
Image is inaccessible to the public (default)
|
Image is inaccessible to the public (default)
|
||||||
|
|
||||||
|
.. option:: --community
|
||||||
|
|
||||||
|
Image is accessible to the community
|
||||||
|
|
||||||
|
.. option:: --shared
|
||||||
|
|
||||||
|
Image can be shared
|
||||||
|
|
||||||
.. option:: --store <store>
|
.. option:: --store <store>
|
||||||
|
|
||||||
Upload image to this store
|
Upload image to this store
|
||||||
|
@ -205,6 +205,16 @@ class CreateImage(command.ShowOne):
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help=_("Image is inaccessible to the public (default)"),
|
help=_("Image is inaccessible to the public (default)"),
|
||||||
)
|
)
|
||||||
|
public_group.add_argument(
|
||||||
|
"--community",
|
||||||
|
action="store_true",
|
||||||
|
help=_("Image is accessible to the community"),
|
||||||
|
)
|
||||||
|
public_group.add_argument(
|
||||||
|
"--shared",
|
||||||
|
action="store_true",
|
||||||
|
help=_("Image can be shared"),
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--property",
|
"--property",
|
||||||
dest="properties",
|
dest="properties",
|
||||||
@ -260,7 +270,7 @@ class CreateImage(command.ShowOne):
|
|||||||
kwargs = {}
|
kwargs = {}
|
||||||
copy_attrs = ('name', 'id',
|
copy_attrs = ('name', 'id',
|
||||||
'container_format', 'disk_format',
|
'container_format', 'disk_format',
|
||||||
'min_disk', 'min_ram', 'tags')
|
'min_disk', 'min_ram', 'tags', 'visibility')
|
||||||
for attr in copy_attrs:
|
for attr in copy_attrs:
|
||||||
if attr in parsed_args:
|
if attr in parsed_args:
|
||||||
val = getattr(parsed_args, attr, None)
|
val = getattr(parsed_args, attr, None)
|
||||||
@ -288,7 +298,10 @@ class CreateImage(command.ShowOne):
|
|||||||
kwargs['visibility'] = 'public'
|
kwargs['visibility'] = 'public'
|
||||||
if parsed_args.private:
|
if parsed_args.private:
|
||||||
kwargs['visibility'] = 'private'
|
kwargs['visibility'] = 'private'
|
||||||
|
if parsed_args.community:
|
||||||
|
kwargs['visibility'] = 'community'
|
||||||
|
if parsed_args.shared:
|
||||||
|
kwargs['visibility'] = 'shared'
|
||||||
# Handle deprecated --owner option
|
# Handle deprecated --owner option
|
||||||
project_arg = parsed_args.project
|
project_arg = parsed_args.project
|
||||||
if parsed_args.owner:
|
if parsed_args.owner:
|
||||||
@ -698,6 +711,16 @@ class SetImage(command.Command):
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help=_("Image is inaccessible to the public (default)"),
|
help=_("Image is inaccessible to the public (default)"),
|
||||||
)
|
)
|
||||||
|
public_group.add_argument(
|
||||||
|
"--community",
|
||||||
|
action="store_true",
|
||||||
|
help=_("Image is accessible to the community"),
|
||||||
|
)
|
||||||
|
public_group.add_argument(
|
||||||
|
"--shared",
|
||||||
|
action="store_true",
|
||||||
|
help=_("Image can be shared"),
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--property",
|
"--property",
|
||||||
dest="properties",
|
dest="properties",
|
||||||
@ -817,7 +840,7 @@ class SetImage(command.Command):
|
|||||||
copy_attrs = ('architecture', 'container_format', 'disk_format',
|
copy_attrs = ('architecture', 'container_format', 'disk_format',
|
||||||
'file', 'instance_id', 'kernel_id', 'locations',
|
'file', 'instance_id', 'kernel_id', 'locations',
|
||||||
'min_disk', 'min_ram', 'name', 'os_distro', 'os_version',
|
'min_disk', 'min_ram', 'name', 'os_distro', 'os_version',
|
||||||
'prefix', 'progress', 'ramdisk_id', 'tags')
|
'prefix', 'progress', 'ramdisk_id', 'tags', 'visibility')
|
||||||
for attr in copy_attrs:
|
for attr in copy_attrs:
|
||||||
if attr in parsed_args:
|
if attr in parsed_args:
|
||||||
val = getattr(parsed_args, attr, None)
|
val = getattr(parsed_args, attr, None)
|
||||||
@ -845,7 +868,10 @@ class SetImage(command.Command):
|
|||||||
kwargs['visibility'] = 'public'
|
kwargs['visibility'] = 'public'
|
||||||
if parsed_args.private:
|
if parsed_args.private:
|
||||||
kwargs['visibility'] = 'private'
|
kwargs['visibility'] = 'private'
|
||||||
|
if parsed_args.community:
|
||||||
|
kwargs['visibility'] = 'community'
|
||||||
|
if parsed_args.shared:
|
||||||
|
kwargs['visibility'] = 'shared'
|
||||||
# Handle deprecated --owner option
|
# Handle deprecated --owner option
|
||||||
project_arg = parsed_args.project
|
project_arg = parsed_args.project
|
||||||
if parsed_args.owner:
|
if parsed_args.owner:
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- Add ``--community`` and ``--shared`` options to the ``image create`` and
|
||||||
|
``image set`` commands to allow image owners to share images across
|
||||||
|
multiple projects without explicitly creating image members.
|
||||||
|
“Community images” will not appear in user’s default
|
||||||
|
image listings.
|
Loading…
Reference in New Issue
Block a user