Submitted by abitowhit on Sat, 01/18/2020 - 19:48
def getip():
try:
stream=os.popen('hostname')
hst=stream.read()
stream=os.popen('hostname -I ')
hip = stream.read()
return "host={0},ip={1}".format(hst.replace(' ',''),hip.replace(' ','')
except:
return 'NA,NA'