#NEWLINE# def create( from_file = None , **kwargs ) : #NEWLINE# #INDENT# '\n    Create a new vm\n\n    from_file : string\n        json file to create the vm from -- if present, all other options will be ignored\n    kwargs : string|int|...\n        options to set for the vm\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt \'*\' vmadm.create from_file=/tmp/new_vm.json\n        salt \'*\' vmadm.create image_uuid=\'...\' alias=\'...\' nics=\'[{ "nic_tag": "admin", "ip": "198.51.100.123", ...}, {...}]\' [...]\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# vmcfg = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# kwargs = salt . utils . clean_kwargs ( ** kwargs ) #NEWLINE# for ( k , v ) in kwargs . iteritems ( ) : #NEWLINE# #INDENT# vmcfg [ k ] = v #NEWLINE# #UNINDENT# if from_file : #NEWLINE# #INDENT# return _create_update_from_file ( 'create' , path = v ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return _create_update_from_cfg ( 'create' , vmcfg = vmcfg )