def _append_domain(opts):
 if opts['id'].endswith(opts['append_domain']):
  return opts['id']
 if opts['id'].endswith('.'):
  return opts['id']
 return '{0[id]}.{0[append_domain]}'.format(opts)

def _append_domain ( opts ) : if opts [ 'id' ] . endswith ( opts [ 'append_domain' ] ) : return opts [ 'id' ] if opts [ 'id' ] . endswith ( '.' ) : return opts [ 'id' ] return '{0[id]}.{0[append_domain]}' . format ( opts )
append a domain to the existing id if it doesnt already exist .