def _additional_sanity_checks(module, zone):
 overwrite = module.params['overwrite']
 record_name = module.params['record']
 record_type = module.params['type']
 state = module.params['state']
 if ((record_type == 'CNAME') and (record_name == zone.domain)):
  module.fail_json(msg='CNAME records cannot match the zone name', changed=False)
 if ((record_type == 'NS') and (record_name == zone.domain) and (state == 'absent')):
  module.fail_json(msg='cannot delete root NS records', changed=False)
 if ((record_type == 'NS') and (record_name == zone.domain) and overwrite):
  module.fail_json(msg='cannot update existing root NS records', changed=False)
 if ((record_type == 'SOA') and (record_name != zone.domain)):
  module.fail_json(msg=('non-root SOA records are not permitted, got: %s' % record_name), changed=False)

def _additional_sanity_checks ( module , zone ) : overwrite = module . params [ 'overwrite' ] record_name = module . params [ 'record' ] record_type = module . params [ 'type' ] state = module . params [ 'state' ] if ( ( record_type == 'CNAME' ) and ( record_name == zone . domain ) ) : module . fail_json ( msg = 'CNAME records cannot match the zone name' , changed = False ) if ( ( record_type == 'NS' ) and ( record_name == zone . domain ) and ( state == 'absent' ) ) : module . fail_json ( msg = 'cannot delete root NS records' , changed = False ) if ( ( record_type == 'NS' ) and ( record_name == zone . domain ) and overwrite ) : module . fail_json ( msg = 'cannot update existing root NS records' , changed = False ) if ( ( record_type == 'SOA' ) and ( record_name != zone . domain ) ) : module . fail_json ( msg = ( 'non-root SOA records are not permitted, got: %s' % record_name ) , changed = False )
run input sanity checks that depend on info from the zone/record .