def secgroup_clone(call=None, kwargs=None):
 if (call != 'function'):
  raise SaltCloudSystemExit('The secgroup_clone function must be called with -f or --function.')
 if (kwargs is None):
  kwargs = {}
 name = kwargs.get('name', None)
 secgroup_id = kwargs.get('secgroup_id', None)
 secgroup_name = kwargs.get('secgroup_name', None)
 if (name is None):
  raise SaltCloudSystemExit("The secgroup_clone function requires a 'name' to be provided.")
 if secgroup_id:
  if secgroup_name:
   log.warning("Both the 'secgroup_id' and 'secgroup_name' arguments were provided. 'secgroup_id' will take precedence.")
 elif secgroup_name:
  secgroup_id = get_secgroup_id(kwargs={'name': secgroup_name})
 else:
  raise SaltCloudSystemExit("The secgroup_clone function requires either a 'secgroup_id' or a 'secgroup_name' to be provided.")
 (server, user, password) = _get_xml_rpc()
 auth = ':'.join([user, password])
 response = server.one.secgroup.clone(auth, int(secgroup_id), name)
 data = {'action': 'secgroup.clone', 'cloned': response[0], 'cloned_secgroup_id': response[1], 'cloned_secgroup_name': name, 'error_code': response[2]}
 return data

def secgroup_clone ( call = None , kwargs = None ) : if ( call != 'function' ) : raise SaltCloudSystemExit ( 'The secgroup_clone function must be called with -f or --function.' ) if ( kwargs is None ) : kwargs = { } name = kwargs . get ( 'name' , None ) secgroup_id = kwargs . get ( 'secgroup_id' , None ) secgroup_name = kwargs . get ( 'secgroup_name' , None ) if ( name is None ) : raise SaltCloudSystemExit ( "The secgroup_clone function requires a 'name' to be provided." ) if secgroup_id : if secgroup_name : log . warning ( "Both the 'secgroup_id' and 'secgroup_name' arguments were provided. 'secgroup_id' will take precedence." ) elif secgroup_name : secgroup_id = get_secgroup_id ( kwargs = { 'name' : secgroup_name } ) else : raise SaltCloudSystemExit ( "The secgroup_clone function requires either a 'secgroup_id' or a 'secgroup_name' to be provided." ) ( server , user , password ) = _get_xml_rpc ( ) auth = ':' . join ( [ user , password ] ) response = server . one . secgroup . clone ( auth , int ( secgroup_id ) , name ) data = { 'action' : 'secgroup.clone' , 'cloned' : response [ 0 ] , 'cloned_secgroup_id' : response [ 1 ] , 'cloned_secgroup_name' : name , 'error_code' : response [ 2 ] } return data
clones an existing security group .