mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 00:31:56 -06:00
Utility function to get the local hostname
This commit is contained in:
parent
83d5987db9
commit
1a8ec58602
@ -30,6 +30,7 @@ import time
|
||||
from types import NoneType
|
||||
from xmlrpclib import Binary
|
||||
import krbV
|
||||
import socket
|
||||
|
||||
|
||||
def get_current_principal():
|
||||
@ -40,6 +41,16 @@ def get_current_principal():
|
||||
print "Unable to get kerberos principal"
|
||||
return None
|
||||
|
||||
def get_fqdn():
|
||||
fqdn = ""
|
||||
try:
|
||||
fqdn = socket.getfqdn()
|
||||
except:
|
||||
try:
|
||||
fqdn = socket.gethostname()
|
||||
except:
|
||||
fqdn = ""
|
||||
return fqdn
|
||||
|
||||
# FIXME: This function has no unit test
|
||||
def find_modules_in_dir(src_dir):
|
||||
|
Loading…
Reference in New Issue
Block a user