def get_hostname(host=None):
    if host is None:
        host = socket.gethostname()
    try:
        return socket.gethostbyaddr(host)[0]
    except socket.herror: # DNS CAN'T RESOLVE HOSTNAME
        return host # JUST USE HOSTNAME AS REPORTED BY gethostname()
Install the given product key
dataset/ETHPy150Open cjlee112/pygr/pygr/coordinator.py/get_hostname--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/win_license.py/install