def repo_absent(name, profile='github', **kwargs):
 ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''}
 try:
  target = __salt__['github.get_repo_info'](name, profile=profile, **kwargs)
 except CommandExecutionError:
  target = None
 if (not target):
  ret['comment'] = 'Repo {0} does not exist'.format(name)
  ret['result'] = True
  return ret
 else:
  if __opts__['test']:
   ret['comment'] = 'Repo {0} will be deleted'.format(name)
   ret['result'] = None
   return ret
  result = __salt__['github.remove_repo'](name, profile=profile, **kwargs)
  if result:
   ret['comment'] = 'Deleted repo {0}'.format(name)
   ret['changes'].setdefault('old', 'Repo {0} exists'.format(name))
   ret['changes'].setdefault('new', 'Repo {0} deleted'.format(name))
   ret['result'] = True
  else:
   ret['comment'] = 'Failed to delete repo {0}. Ensure the delete_repo scope is enabled if using OAuth.'.format(name)
   ret['result'] = False
 return ret

def repo_absent ( name , profile = 'github' , ** kwargs ) : ret = { 'name' : name , 'changes' : { } , 'result' : None , 'comment' : '' } try : target = __salt__ [ 'github.get_repo_info' ] ( name , profile = profile , ** kwargs ) except CommandExecutionError : target = None if ( not target ) : ret [ 'comment' ] = 'Repo {0} does not exist' . format ( name ) ret [ 'result' ] = True return ret else : if __opts__ [ 'test' ] : ret [ 'comment' ] = 'Repo {0} will be deleted' . format ( name ) ret [ 'result' ] = None return ret result = __salt__ [ 'github.remove_repo' ] ( name , profile = profile , ** kwargs ) if result : ret [ 'comment' ] = 'Deleted repo {0}' . format ( name ) ret [ 'changes' ] . setdefault ( 'old' , 'Repo {0} exists' . format ( name ) ) ret [ 'changes' ] . setdefault ( 'new' , 'Repo {0} deleted' . format ( name ) ) ret [ 'result' ] = True else : ret [ 'comment' ] = 'Failed to delete repo {0}. Ensure the delete_repo scope is enabled if using OAuth.' . format ( name ) ret [ 'result' ] = False return ret
ensure a repo is absent .