def resource_present(resource, identifier_fields, diff=None, profile='pagerduty', subdomain=None, api_key=None, **kwargs):
 ret = {'name': kwargs['name'], 'changes': {}, 'result': None, 'comment': ''}
 result = create_or_update_resource(resource, identifier_fields, kwargs, diff=diff, profile=profile, subdomain=subdomain, api_key=api_key)
 if (result is True):
  pass
 elif (result is None):
  ret['result'] = True
 elif __opts__['test']:
  ret['comment'] = result
 elif ('error' in result):
  ret['result'] = False
  ret['comment'] = result
 else:
  ret['result'] = True
  ret['comment'] = result
 return ret

def resource_present ( resource , identifier_fields , diff = None , profile = 'pagerduty' , subdomain = None , api_key = None , ** kwargs ) : ret = { 'name' : kwargs [ 'name' ] , 'changes' : { } , 'result' : None , 'comment' : '' } result = create_or_update_resource ( resource , identifier_fields , kwargs , diff = diff , profile = profile , subdomain = subdomain , api_key = api_key ) if ( result is True ) : pass elif ( result is None ) : ret [ 'result' ] = True elif __opts__ [ 'test' ] : ret [ 'comment' ] = result elif ( 'error' in result ) : ret [ 'result' ] = False ret [ 'comment' ] = result else : ret [ 'result' ] = True ret [ 'comment' ] = result return ret
generic resource .