def sync_domains(site, domains, bench_path='.'):
 changed = False
 existing_domains = get_domains_dict(get_domains(site, bench_path))
 new_domains = get_domains_dict(domains)
 if (set(existing_domains.keys()) != set(new_domains.keys())):
  changed = True
 else:
  for d in existing_domains.values():
   if (d != new_domains.get(d['domain'])):
    changed = True
    break
 if changed:
  update_site_config(site, {'domains': domains}, bench_path='.')
 return changed

def sync_domains ( site , domains , bench_path = '.' ) : changed = False existing_domains = get_domains_dict ( get_domains ( site , bench_path ) ) new_domains = get_domains_dict ( domains ) if ( set ( existing_domains . keys ( ) ) != set ( new_domains . keys ( ) ) ) : changed = True else : for d in existing_domains . values ( ) : if ( d != new_domains . get ( d [ 'domain' ] ) ) : changed = True break if changed : update_site_config ( site , { 'domains' : domains } , bench_path = '.' ) return changed
checks if there is a change in domains .