Remove deprecated image commands
* Remove ``image create|set`` option ``--owner`` Change-Id: I1fabab98c8660eba6d0dd75e74544c6c9d432b9e Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
parent
f9fdc296bc
commit
67dadda746
doc/source/cli
openstackclient
releasenotes/notes
@ -49,6 +49,12 @@ Release 4.0
|
|||||||
* Removed in: 4.0
|
* Removed in: 4.0
|
||||||
* Commit: https://review.opendev.org/612798
|
* Commit: https://review.opendev.org/612798
|
||||||
|
|
||||||
|
6. Remove ``image create|set`` option ``--owner``.
|
||||||
|
Use ``--project`` option instead.
|
||||||
|
|
||||||
|
* Removed in: 4.0
|
||||||
|
* Commit: https://review.opendev.org/659431
|
||||||
|
|
||||||
.. 1. Change ``volume transfer request accept`` to use new option ``--auth-key``
|
.. 1. Change ``volume transfer request accept`` to use new option ``--auth-key``
|
||||||
.. rather than a second positional argument.
|
.. rather than a second positional argument.
|
||||||
|
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
explain,WONTFIX,Describe a specific model.
|
explain,WONTFIX,Describe a specific model.
|
||||||
image-create,image create,Create a new image.
|
image-create,image create,Create a new image.
|
||||||
image-deactivate,image set --deactivate,Deactivate specified image.
|
image-deactivate,image set --deactivate,Deactivate specified image.
|
||||||
image-delete,image delete,Delete specified image.
|
image-delete,image delete,Delete specified image.
|
||||||
image-download,image save,Download a specific image.
|
image-download,image save,Download a specific image.
|
||||||
image-list,image list,List images you can access.
|
image-list,image list,List images you can access.
|
||||||
image-reactivate,image set --activate,Reactivate specified image.
|
image-reactivate,image set --activate,Reactivate specified image.
|
||||||
image-show,image show,Describe a specific image.
|
image-show,image show,Describe a specific image.
|
||||||
image-tag-delete,image set --tag <tag>,Delete the tag associated with the given image.
|
image-tag-delete,image unset --tag <tag>,Delete the tag associated with the given image.
|
||||||
image-tag-update,image unset --tag <tag>,Update an image with the given tag.
|
image-tag-update,image set --tag <tag>,Update an image with the given tag.
|
||||||
image-update,image set,Update an existing image.
|
image-update,image set,Update an existing image.
|
||||||
image-upload,,Upload data for a specific image.
|
image-upload,,Upload data for a specific image.
|
||||||
location-add,,Add a location (and related metadata) to an image.
|
location-add,,Add a location (and related metadata) to an image.
|
||||||
location-delete,,Remove locations (and related metadata) from an image.
|
location-delete,,Remove locations (and related metadata) from an image.
|
||||||
location-update,,Update metadata of an image's location.
|
location-update,,Update metadata of an image's location.
|
||||||
member-create,image add project,Create member for a given image.
|
member-create,image add project,Create member for a given image.
|
||||||
member-delete,image remove project,Delete image member.
|
member-delete,image remove project,Delete image member.
|
||||||
member-list,,Describe sharing permissions by image.
|
member-list,,Describe sharing permissions by image.
|
||||||
member-update,image set --accept --reject --status,Update the status of a member for a given image.
|
member-update,image set --accept --reject --status,Update the status of a member for a given image.
|
||||||
task-create,,Create a new task.
|
task-create,,Create a new task.
|
||||||
task-list,,List tasks you can access.
|
task-list,,List tasks you can access.
|
||||||
task-show,,Describe a specific task.
|
task-show,,Describe a specific task.
|
||||||
bash-completion,complete,Prints arguments for bash_completion.
|
bash-completion,complete,Prints arguments for bash_completion.
|
||||||
help,help,Display help about this program or one of its subcommands.
|
help,help,Display help about this program or one of its subcommands.
|
||||||
|
|
@ -182,29 +182,16 @@ class CreateImage(command.ShowOne):
|
|||||||
help=_("Set a property on this image "
|
help=_("Set a property on this image "
|
||||||
"(repeat option to set multiple properties)"),
|
"(repeat option to set multiple properties)"),
|
||||||
)
|
)
|
||||||
# NOTE(dtroyer): --owner is deprecated in Jan 2016 in an early
|
parser.add_argument(
|
||||||
# 2.x release. Do not remove before Jan 2017
|
|
||||||
# and a 3.x release.
|
|
||||||
project_group = parser.add_mutually_exclusive_group()
|
|
||||||
project_group.add_argument(
|
|
||||||
"--project",
|
"--project",
|
||||||
metavar="<project>",
|
metavar="<project>",
|
||||||
help=_("Set an alternate project on this image (name or ID)"),
|
help=_("Set an alternate project on this image (name or ID)"),
|
||||||
)
|
)
|
||||||
project_group.add_argument(
|
|
||||||
"--owner",
|
|
||||||
metavar="<project>",
|
|
||||||
help=argparse.SUPPRESS,
|
|
||||||
)
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
image_client = self.app.client_manager.image
|
image_client = self.app.client_manager.image
|
||||||
|
|
||||||
if getattr(parsed_args, 'owner', None) is not None:
|
|
||||||
LOG.warning(_('The --owner option is deprecated, '
|
|
||||||
'please use --project instead.'))
|
|
||||||
|
|
||||||
# Build an attribute dict from the parsed args, only include
|
# Build an attribute dict from the parsed args, only include
|
||||||
# attributes that were actually set on the command line
|
# attributes that were actually set on the command line
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
@ -599,29 +586,16 @@ class SetImage(command.Command):
|
|||||||
metavar="<checksum>",
|
metavar="<checksum>",
|
||||||
help=_("Image hash used for verification"),
|
help=_("Image hash used for verification"),
|
||||||
)
|
)
|
||||||
# NOTE(dtroyer): --owner is deprecated in Jan 2016 in an early
|
parser.add_argument(
|
||||||
# 2.x release. Do not remove before Jan 2017
|
|
||||||
# and a 3.x release.
|
|
||||||
project_group = parser.add_mutually_exclusive_group()
|
|
||||||
project_group.add_argument(
|
|
||||||
"--project",
|
"--project",
|
||||||
metavar="<project>",
|
metavar="<project>",
|
||||||
help=_("Set an alternate project on this image (name or ID)"),
|
help=_("Set an alternate project on this image (name or ID)"),
|
||||||
)
|
)
|
||||||
project_group.add_argument(
|
|
||||||
"--owner",
|
|
||||||
metavar="<project>",
|
|
||||||
help=argparse.SUPPRESS,
|
|
||||||
)
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
image_client = self.app.client_manager.image
|
image_client = self.app.client_manager.image
|
||||||
|
|
||||||
if getattr(parsed_args, 'owner', None) is not None:
|
|
||||||
LOG.warning(_('The --owner option is deprecated, '
|
|
||||||
'please use --project instead.'))
|
|
||||||
|
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
copy_attrs = ('name', 'owner', 'min_disk', 'min_ram', 'properties',
|
copy_attrs = ('name', 'owner', 'min_disk', 'min_ram', 'properties',
|
||||||
'container_format', 'disk_format', 'size', 'store',
|
'container_format', 'disk_format', 'size', 'store',
|
||||||
|
@ -250,20 +250,11 @@ class CreateImage(command.ShowOne):
|
|||||||
help=_("Set a tag on this image "
|
help=_("Set a tag on this image "
|
||||||
"(repeat option to set multiple tags)"),
|
"(repeat option to set multiple tags)"),
|
||||||
)
|
)
|
||||||
# NOTE(dtroyer): --owner is deprecated in Jan 2016 in an early
|
parser.add_argument(
|
||||||
# 2.x release. Do not remove before Jan 2017
|
|
||||||
# and a 3.x release.
|
|
||||||
project_group = parser.add_mutually_exclusive_group()
|
|
||||||
project_group.add_argument(
|
|
||||||
"--project",
|
"--project",
|
||||||
metavar="<project>",
|
metavar="<project>",
|
||||||
help=_("Set an alternate project on this image (name or ID)"),
|
help=_("Set an alternate project on this image (name or ID)"),
|
||||||
)
|
)
|
||||||
project_group.add_argument(
|
|
||||||
"--owner",
|
|
||||||
metavar="<project>",
|
|
||||||
help=argparse.SUPPRESS,
|
|
||||||
)
|
|
||||||
common.add_project_domain_option_to_parser(parser)
|
common.add_project_domain_option_to_parser(parser)
|
||||||
for deadopt in self.deadopts:
|
for deadopt in self.deadopts:
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@ -321,16 +312,10 @@ class CreateImage(command.ShowOne):
|
|||||||
kwargs['visibility'] = 'community'
|
kwargs['visibility'] = 'community'
|
||||||
if parsed_args.shared:
|
if parsed_args.shared:
|
||||||
kwargs['visibility'] = 'shared'
|
kwargs['visibility'] = 'shared'
|
||||||
# Handle deprecated --owner option
|
if parsed_args.project:
|
||||||
project_arg = parsed_args.project
|
|
||||||
if parsed_args.owner:
|
|
||||||
project_arg = parsed_args.owner
|
|
||||||
LOG.warning(_('The --owner option is deprecated, '
|
|
||||||
'please use --project instead.'))
|
|
||||||
if project_arg:
|
|
||||||
kwargs['owner'] = common.find_project(
|
kwargs['owner'] = common.find_project(
|
||||||
identity_client,
|
identity_client,
|
||||||
project_arg,
|
parsed_args.project,
|
||||||
parsed_args.project_domain,
|
parsed_args.project_domain,
|
||||||
).id
|
).id
|
||||||
|
|
||||||
@ -347,13 +332,6 @@ class CreateImage(command.ShowOne):
|
|||||||
LOG.warning(_("Failed to get an image file."))
|
LOG.warning(_("Failed to get an image file."))
|
||||||
return {}, {}
|
return {}, {}
|
||||||
|
|
||||||
if parsed_args.owner:
|
|
||||||
kwargs['owner'] = common.find_project(
|
|
||||||
identity_client,
|
|
||||||
parsed_args.owner,
|
|
||||||
parsed_args.project_domain,
|
|
||||||
).id
|
|
||||||
|
|
||||||
# sign an image using a given local private key file
|
# sign an image using a given local private key file
|
||||||
if parsed_args.sign_key_path or parsed_args.sign_cert_id:
|
if parsed_args.sign_key_path or parsed_args.sign_cert_id:
|
||||||
if not parsed_args.file:
|
if not parsed_args.file:
|
||||||
@ -933,20 +911,11 @@ class SetImage(command.Command):
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help=_("Activate the image"),
|
help=_("Activate the image"),
|
||||||
)
|
)
|
||||||
# NOTE(dtroyer): --owner is deprecated in Jan 2016 in an early
|
parser.add_argument(
|
||||||
# 2.x release. Do not remove before Jan 2017
|
|
||||||
# and a 3.x release.
|
|
||||||
project_group = parser.add_mutually_exclusive_group()
|
|
||||||
project_group.add_argument(
|
|
||||||
"--project",
|
"--project",
|
||||||
metavar="<project>",
|
metavar="<project>",
|
||||||
help=_("Set an alternate project on this image (name or ID)"),
|
help=_("Set an alternate project on this image (name or ID)"),
|
||||||
)
|
)
|
||||||
project_group.add_argument(
|
|
||||||
"--owner",
|
|
||||||
metavar="<project>",
|
|
||||||
help=argparse.SUPPRESS,
|
|
||||||
)
|
|
||||||
common.add_project_domain_option_to_parser(parser)
|
common.add_project_domain_option_to_parser(parser)
|
||||||
for deadopt in self.deadopts:
|
for deadopt in self.deadopts:
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@ -1020,17 +989,11 @@ class SetImage(command.Command):
|
|||||||
kwargs['visibility'] = 'community'
|
kwargs['visibility'] = 'community'
|
||||||
if parsed_args.shared:
|
if parsed_args.shared:
|
||||||
kwargs['visibility'] = 'shared'
|
kwargs['visibility'] = 'shared'
|
||||||
# Handle deprecated --owner option
|
|
||||||
project_arg = parsed_args.project
|
|
||||||
if parsed_args.owner:
|
|
||||||
project_arg = parsed_args.owner
|
|
||||||
LOG.warning(_('The --owner option is deprecated, '
|
|
||||||
'please use --project instead.'))
|
|
||||||
project_id = None
|
project_id = None
|
||||||
if project_arg:
|
if parsed_args.project:
|
||||||
project_id = common.find_project(
|
project_id = common.find_project(
|
||||||
identity_client,
|
identity_client,
|
||||||
project_arg,
|
parsed_args.project,
|
||||||
parsed_args.project_domain,
|
parsed_args.project_domain,
|
||||||
).id
|
).id
|
||||||
kwargs['owner'] = project_id
|
kwargs['owner'] = project_id
|
||||||
|
@ -188,40 +188,6 @@ class TestImageCreate(TestImage):
|
|||||||
image_fakes.FakeImage.get_image_data(self.new_image),
|
image_fakes.FakeImage.get_image_data(self.new_image),
|
||||||
data)
|
data)
|
||||||
|
|
||||||
def test_image_create_with_unexist_owner(self):
|
|
||||||
self.project_mock.get.side_effect = exceptions.NotFound(None)
|
|
||||||
self.project_mock.find.side_effect = exceptions.NotFound(None)
|
|
||||||
|
|
||||||
arglist = [
|
|
||||||
'--container-format', 'ovf',
|
|
||||||
'--disk-format', 'ami',
|
|
||||||
'--min-disk', '10',
|
|
||||||
'--min-ram', '4',
|
|
||||||
'--owner', 'unexist_owner',
|
|
||||||
'--protected',
|
|
||||||
'--private',
|
|
||||||
image_fakes.image_name,
|
|
||||||
]
|
|
||||||
verifylist = [
|
|
||||||
('container_format', 'ovf'),
|
|
||||||
('disk_format', 'ami'),
|
|
||||||
('min_disk', 10),
|
|
||||||
('min_ram', 4),
|
|
||||||
('owner', 'unexist_owner'),
|
|
||||||
('protected', True),
|
|
||||||
('unprotected', False),
|
|
||||||
('public', False),
|
|
||||||
('private', True),
|
|
||||||
('name', image_fakes.image_name),
|
|
||||||
]
|
|
||||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
||||||
|
|
||||||
self.assertRaises(
|
|
||||||
exceptions.CommandError,
|
|
||||||
self.cmd.take_action,
|
|
||||||
parsed_args,
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_image_create_with_unexist_project(self):
|
def test_image_create_with_unexist_project(self):
|
||||||
self.project_mock.get.side_effect = exceptions.NotFound(None)
|
self.project_mock.get.side_effect = exceptions.NotFound(None)
|
||||||
self.project_mock.find.side_effect = exceptions.NotFound(None)
|
self.project_mock.find.side_effect = exceptions.NotFound(None)
|
||||||
@ -1146,24 +1112,6 @@ class TestImageSet(TestImage):
|
|||||||
image_fakes.image_id, **kwargs)
|
image_fakes.image_id, **kwargs)
|
||||||
self.assertIsNone(result)
|
self.assertIsNone(result)
|
||||||
|
|
||||||
def test_image_set_with_unexist_owner(self):
|
|
||||||
self.project_mock.get.side_effect = exceptions.NotFound(None)
|
|
||||||
self.project_mock.find.side_effect = exceptions.NotFound(None)
|
|
||||||
|
|
||||||
arglist = [
|
|
||||||
'--owner', 'unexist_owner',
|
|
||||||
image_fakes.image_id,
|
|
||||||
]
|
|
||||||
verifylist = [
|
|
||||||
('owner', 'unexist_owner'),
|
|
||||||
('image', image_fakes.image_id),
|
|
||||||
]
|
|
||||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
||||||
|
|
||||||
self.assertRaises(
|
|
||||||
exceptions.CommandError,
|
|
||||||
self.cmd.take_action, parsed_args)
|
|
||||||
|
|
||||||
def test_image_set_with_unexist_project(self):
|
def test_image_set_with_unexist_project(self):
|
||||||
self.project_mock.get.side_effect = exceptions.NotFound(None)
|
self.project_mock.get.side_effect = exceptions.NotFound(None)
|
||||||
self.project_mock.find.side_effect = exceptions.NotFound(None)
|
self.project_mock.find.side_effect = exceptions.NotFound(None)
|
||||||
|
5
releasenotes/notes/osc4-image-e922ee6f8e028648.yaml
Normal file
5
releasenotes/notes/osc4-image-e922ee6f8e028648.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Remove ``image create|set`` option ``--owner``.
|
||||||
|
Use ``--project`` option instead.
|
Loading…
x
Reference in New Issue
Block a user