Remove spec file profile-update command

We were using profile-update command to create a new profile if 'spec'
is provided. This is an abuse of the command. It is creating confusion
rather than convenience (original thought). This patch removes the
'spec' parameter so users will better understand that 'spec' is designed
to be read-only.

Change-Id: I2ee0aeea2b612dbfb27263dbf2ac203698f257e5
This commit is contained in:
tengqm
2015-11-17 20:52:31 -05:00
parent 16ded80500
commit 9d6956e8fb

View File

@@ -168,8 +168,6 @@ def do_profile_show(sc, args):
@utils.arg('-n', '--name', metavar='<NAME>', @utils.arg('-n', '--name', metavar='<NAME>',
help=_('The new name for the profile.')) help=_('The new name for the profile.'))
@utils.arg('-s', '--spec-file', metavar='<SPEC FILE>',
help=_('The new spec file for the profile.'))
@utils.arg('-p', '--permission', metavar='<PERMISSION>', default='', @utils.arg('-p', '--permission', metavar='<PERMISSION>', default='',
help=_('A string format permission for this profile.')) help=_('A string format permission for this profile.'))
@utils.arg('-M', '--metadata', metavar='<KEY1=VALUE1;KEY2=VALUE2...>', @utils.arg('-M', '--metadata', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
@@ -181,15 +179,8 @@ def do_profile_show(sc, args):
help=_('Name or ID of the profile to update.')) help=_('Name or ID of the profile to update.'))
def do_profile_update(sc, args): def do_profile_update(sc, args):
'''Update a profile.''' '''Update a profile.'''
spec = None
if args.spec_file:
spec = utils.get_spec_content(args.spec_file)
type_name = spec['type']
if type_name == 'os.heat.stack':
spec['properties'] = utils.process_stack_spec(spec['properties'])
params = { params = {
'name': args.name, 'name': args.name,
'spec': spec,
'permission': args.permission, 'permission': args.permission,
} }
if args.metadata: if args.metadata: