#NEWLINE# @ utils . arg ( '-s' , '--spec-file' , metavar = '<SPEC FILE>' , required = True , help = _ ( 'The spec file used to create the profile.' ) ) #NEWLINE# @ utils . arg ( '-M' , '--metadata' , metavar = '<KEY1=VALUE1;KEY2=VALUE2...>' , help = _ ( 'Metadata values to be attached to the profile. This can be specified multiple times, or once with key-value pairs separated by a semicolon.' ) , action = 'append' ) #NEWLINE# @ utils . arg ( 'name' , metavar = '<PROFILE_NAME>' , help = _ ( 'Name of the profile to create.' ) ) #NEWLINE# def do_profile_create( service , args ) : #NEWLINE# #INDENT# 'Create a profile.' #NEWLINE# show_deprecated ( 'senlin profile-create' , 'openstack cluster profile create' ) #NEWLINE# spec = utils . get_spec_content ( args . spec_file ) #NEWLINE# type_name = spec . get ( 'type' , None ) #NEWLINE# type_version = spec . get ( 'version' , None ) #NEWLINE# properties = spec . get ( 'properties' , None ) #NEWLINE# if ( type_name is None ) : #NEWLINE# #INDENT# raise exc . CommandError ( _ ( "Missing 'type' key in spec file." ) ) #NEWLINE# #UNINDENT# if ( type_version is None ) : #NEWLINE# #INDENT# raise exc . CommandError ( _ ( "Missing 'version' key in spec file." ) ) #NEWLINE# #UNINDENT# if ( properties is None ) : #NEWLINE# #INDENT# raise exc . CommandError ( _ ( "Missing 'properties' key in spec file." ) ) #NEWLINE# #UNINDENT# if ( type_name == 'os.heat.stack' ) : #NEWLINE# #INDENT# stack_properties = utils . process_stack_spec ( properties ) #NEWLINE# spec [ 'properties' ] = properties #NEWLINE# #UNINDENT# params = { #NEWLINE# #INDENT# 'name' : args . name , #NEWLINE# 'spec' : spec , #NEWLINE# 'metadata' : utils . format_parameters ( args . metadata ) , #NEWLINE# #UNINDENT# } #NEWLINE# profile = service . create_profile ( ** params ) #NEWLINE# _show_profile ( service , profile . id )