Merge "Template is not required on stack-adopt"
This commit is contained in:
commit
407a69995d
@ -1202,15 +1202,13 @@ class ShellTestUserPass(ShellBase):
|
|||||||
|
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
template_file = os.path.join(TEST_VAR_DIR, 'minimal.template')
|
|
||||||
adopt_data_file = os.path.join(TEST_VAR_DIR, 'adopt_stack_data.json')
|
adopt_data_file = os.path.join(TEST_VAR_DIR, 'adopt_stack_data.json')
|
||||||
adopt_text = self.shell(
|
adopt_text = self.shell(
|
||||||
'stack-adopt teststack '
|
'stack-adopt teststack '
|
||||||
'--template-file=%s '
|
|
||||||
'--adopt-file=%s '
|
'--adopt-file=%s '
|
||||||
'--parameters="InstanceType=m1.large;DBUsername=wp;'
|
'--parameters="InstanceType=m1.large;DBUsername=wp;'
|
||||||
'DBPassword=verybadpassword;KeyName=heat_key;'
|
'DBPassword=verybadpassword;KeyName=heat_key;'
|
||||||
'LinuxDistribution=F17"' % (template_file, adopt_data_file))
|
'LinuxDistribution=F17"' % (adopt_data_file))
|
||||||
|
|
||||||
required = [
|
required = [
|
||||||
'stack_name',
|
'stack_name',
|
||||||
@ -1227,10 +1225,7 @@ class ShellTestUserPass(ShellBase):
|
|||||||
self.register_keystone_auth_fixture()
|
self.register_keystone_auth_fixture()
|
||||||
failed_msg = 'Need to specify --adopt-file'
|
failed_msg = 'Need to specify --adopt-file'
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
template_file = os.path.join(TEST_VAR_DIR, 'minimal.template')
|
self.shell_error('stack-adopt teststack ', failed_msg)
|
||||||
self.shell_error(
|
|
||||||
'stack-adopt teststack '
|
|
||||||
'--template-file=%s ' % template_file, failed_msg)
|
|
||||||
|
|
||||||
@httpretty.activate
|
@httpretty.activate
|
||||||
def test_stack_update(self):
|
def test_stack_update(self):
|
||||||
|
@ -114,15 +114,9 @@ def do_stack_create(hc, args):
|
|||||||
do_stack_list(hc)
|
do_stack_list(hc)
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('-f', '--template-file', metavar='<FILE>',
|
|
||||||
help='Path to the template.')
|
|
||||||
@utils.arg('-e', '--environment-file', metavar='<FILE or URL>',
|
@utils.arg('-e', '--environment-file', metavar='<FILE or URL>',
|
||||||
help='Path to the environment, it can be specified multiple times.',
|
help='Path to the environment, it can be specified multiple times.',
|
||||||
action='append')
|
action='append')
|
||||||
@utils.arg('-u', '--template-url', metavar='<URL>',
|
|
||||||
help='URL of template.')
|
|
||||||
@utils.arg('-o', '--template-object', metavar='<URL>',
|
|
||||||
help='URL to retrieve template object (e.g. from swift).')
|
|
||||||
@utils.arg('-c', '--create-timeout', metavar='<TIMEOUT>',
|
@utils.arg('-c', '--create-timeout', metavar='<TIMEOUT>',
|
||||||
type=int,
|
type=int,
|
||||||
help='Stack creation timeout in minutes.'
|
help='Stack creation timeout in minutes.'
|
||||||
@ -143,13 +137,8 @@ def do_stack_create(hc, args):
|
|||||||
help='Name of the stack to adopt.')
|
help='Name of the stack to adopt.')
|
||||||
def do_stack_adopt(hc, args):
|
def do_stack_adopt(hc, args):
|
||||||
'''Adopt a stack.'''
|
'''Adopt a stack.'''
|
||||||
tpl_files, template = template_utils.get_template_contents(
|
env_files, env = template_utils.process_environment_and_files(
|
||||||
args.template_file,
|
env_path=args.environment_file)
|
||||||
args.template_url,
|
|
||||||
args.template_object,
|
|
||||||
hc.http_client.raw_request)
|
|
||||||
env_files, env = template_utils.process_multiple_environments_and_files(
|
|
||||||
env_paths=args.environment_file)
|
|
||||||
|
|
||||||
if not args.adopt_file:
|
if not args.adopt_file:
|
||||||
raise exc.CommandError('Need to specify --adopt-file')
|
raise exc.CommandError('Need to specify --adopt-file')
|
||||||
@ -166,8 +155,7 @@ def do_stack_adopt(hc, args):
|
|||||||
'disable_rollback': not(args.enable_rollback),
|
'disable_rollback': not(args.enable_rollback),
|
||||||
'adopt_stack_data': adopt_data,
|
'adopt_stack_data': adopt_data,
|
||||||
'parameters': utils.format_parameters(args.parameters),
|
'parameters': utils.format_parameters(args.parameters),
|
||||||
'template': template,
|
'files': dict(list(env_files.items())),
|
||||||
'files': dict(list(tpl_files.items()) + list(env_files.items())),
|
|
||||||
'environment': env
|
'environment': env
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user