def matching_subdomains(new_value, old_value):
 if ((new_value is None) and (old_value is not None)):
  return False
 if (new_value.lower() == old_value.lower()):
  return True
 new_domain = naked_domain(new_value)
 old_domain = naked_domain(old_value)
 if (new_domain == old_domain):
  return True
 new_parent_domain = parent_domain(new_value)
 old_parent_domain = parent_domain(old_value)
 if (old_parent_domain is None):
  log.error('old_parent_domain is None', old_value=old_value, new_value=new_value)
  return False
 if (new_parent_domain is None):
  log.error('new_parent_domain is None', old_value=old_value, new_value=new_value)
  return False
 if (new_parent_domain != old_parent_domain):
  log.error("Domains aren't matching", new_value=new_value, old_value=old_value)
  return False
 new_ip = resolve_hostname(new_value)
 old_ip = resolve_hostname(old_value)
 if ((new_ip is None) or (old_ip is None) or (new_ip != old_ip)):
  log.error("IP addresses aren't matching", new_value=new_value, old_Value=old_value)
  return False
 return True

def matching_subdomains ( new_value , old_value ) : if ( ( new_value is None ) and ( old_value is not None ) ) : return False if ( new_value . lower ( ) == old_value . lower ( ) ) : return True new_domain = naked_domain ( new_value ) old_domain = naked_domain ( old_value ) if ( new_domain == old_domain ) : return True new_parent_domain = parent_domain ( new_value ) old_parent_domain = parent_domain ( old_value ) if ( old_parent_domain is None ) : log . error ( 'old_parent_domain is None' , old_value = old_value , new_value = new_value ) return False if ( new_parent_domain is None ) : log . error ( 'new_parent_domain is None' , old_value = old_value , new_value = new_value ) return False if ( new_parent_domain != old_parent_domain ) : log . error ( "Domains aren't matching" , new_value = new_value , old_value = old_value ) return False new_ip = resolve_hostname ( new_value ) old_ip = resolve_hostname ( old_value ) if ( ( new_ip is None ) or ( old_ip is None ) or ( new_ip != old_ip ) ) : log . error ( "IP addresses aren't matching" , new_value = new_value , old_Value = old_value ) return False return True
we allow our customers to update their server addresses .