def get_dn(fqdn=None):
 val = []
 LOG = logging.getLogger(__name__)
 try:
  if (fqdn is None):
   fqdn = socket.getfqdn()
  if ('.' in fqdn):
   tups = fqdn.split('.')
   if (len(tups) > 2):
    val.append(('.%s' % '.'.join(tups[(-2):])))
   else:
    LOG.warning("allowed_hosts value to '*'. It is a security risk")
    val.append('*')
  else:
   LOG.warning("allowed_hosts value to '*'. It is a security risk")
   val.append('*')
 except:
  LOG.warning("allowed_hosts value to '*'. It is a security risk")
  val.append('*')
 return val

def get_dn ( fqdn = None ) : val = [ ] LOG = logging . getLogger ( __name__ ) try : if ( fqdn is None ) : fqdn = socket . getfqdn ( ) if ( '.' in fqdn ) : tups = fqdn . split ( '.' ) if ( len ( tups ) > 2 ) : val . append ( ( '.%s' % '.' . join ( tups [ ( - 2 ) : ] ) ) ) else : LOG . warning ( "allowed_hosts value to '*'. It is a security risk" ) val . append ( '*' ) else : LOG . warning ( "allowed_hosts value to '*'. It is a security risk" ) val . append ( '*' ) except : LOG . warning ( "allowed_hosts value to '*'. It is a security risk" ) val . append ( '*' ) return val
this function returns fqdn .