def set_target(alias, target):
 if (alias == ''):
  raise SaltInvocationError('alias can not be an empty string')
 if (target == ''):
  raise SaltInvocationError('target can not be an empty string')
 if (get_target(alias) == target):
  return True
 lines = __parse_aliases()
 out = []
 ovr = False
 for (line_alias, line_target, line_comment) in lines:
  if (line_alias == alias):
   if (not ovr):
    out.append((alias, target, line_comment))
    ovr = True
  else:
   out.append((line_alias, line_target, line_comment))
 if (not ovr):
  out.append((alias, target, ''))
 __write_aliases_file(out)
 return True

def set_target ( alias , target ) : if ( alias == '' ) : raise SaltInvocationError ( 'alias can not be an empty string' ) if ( target == '' ) : raise SaltInvocationError ( 'target can not be an empty string' ) if ( get_target ( alias ) == target ) : return True lines = __parse_aliases ( ) out = [ ] ovr = False for ( line_alias , line_target , line_comment ) in lines : if ( line_alias == alias ) : if ( not ovr ) : out . append ( ( alias , target , line_comment ) ) ovr = True else : out . append ( ( line_alias , line_target , line_comment ) ) if ( not ovr ) : out . append ( ( alias , target , '' ) ) __write_aliases_file ( out ) return True
set the entry in the aliases file for the given alias .