@staticmethod
    def _getHostname():

        with open('/proc/cmdline') as fo:
            cpu_cmdline = fo.readline().strip()
        regex = re.search('(?<=BOOTIF=)([0-9a-fA-F-]*)', cpu_cmdline)
        if regex:
            mac = regex.group(0).upper()
            return ''.join(mac.split('-'))
        return os.uname()[1]
Generate hostname by BOOTIF kernel option or use os.uname().
dataset/ETHPy150Open openstack/bareon/contrib/fuel_bootstrap/files/trusty/usr/bin/send2syslog.py/Config._getHostname