def image_persistent(call=None, kwargs=None):
 if (call != 'function'):
  raise SaltCloudSystemExit('The image_persistent function must be called with -f or --function.')
 if (kwargs is None):
  kwargs = {}
 name = kwargs.get('name', None)
 persist = kwargs.get('persist', None)
 image_id = kwargs.get('image_id', None)
 if (persist is None):
  raise SaltCloudSystemExit("The image_persistent function requires 'persist' to be set to 'True' or 'False'.")
 if image_id:
  if name:
   log.warning("Both the 'image_id' and 'name' arguments were provided. 'image_id' will take precedence.")
 elif name:
  image_id = get_image_id(kwargs={'name': name})
 else:
  raise SaltCloudSystemExit("The image_persistent function requires either a 'name' or an 'image_id' to be provided.")
 (server, user, password) = _get_xml_rpc()
 auth = ':'.join([user, password])
 response = server.one.image.persistent(auth, int(image_id), salt.utils.is_true(persist))
 data = {'action': 'image.persistent', 'response': response[0], 'image_id': response[1], 'error_code': response[2]}
 return data

def image_persistent ( call = None , kwargs = None ) : if ( call != 'function' ) : raise SaltCloudSystemExit ( 'The image_persistent function must be called with -f or --function.' ) if ( kwargs is None ) : kwargs = { } name = kwargs . get ( 'name' , None ) persist = kwargs . get ( 'persist' , None ) image_id = kwargs . get ( 'image_id' , None ) if ( persist is None ) : raise SaltCloudSystemExit ( "The image_persistent function requires 'persist' to be set to 'True' or 'False'." ) if image_id : if name : log . warning ( "Both the 'image_id' and 'name' arguments were provided. 'image_id' will take precedence." ) elif name : image_id = get_image_id ( kwargs = { 'name' : name } ) else : raise SaltCloudSystemExit ( "The image_persistent function requires either a 'name' or an 'image_id' to be provided." ) ( server , user , password ) = _get_xml_rpc ( ) auth = ':' . join ( [ user , password ] ) response = server . one . image . persistent ( auth , int ( image_id ) , salt . utils . is_true ( persist ) ) data = { 'action' : 'image.persistent' , 'response' : response [ 0 ] , 'image_id' : response [ 1 ] , 'error_code' : response [ 2 ] } return data
sets the image as persistent or not persistent .