def get_hostname():
    """
    Will fetch current hostname of VM if any and return.
    Looks at /etc/rc.conf config for FreeBSD server.
    """
    try:
        with open(RCCONF_FILE) as hostname_fyl:
            for line in hostname_fyl.readlines():
                hn = re.search('hostname=(.*)', line)
                if hn:
                    return hn.group(1)
        return None

    except Exception, e:
        logging.info("Current FreeBSD hostname enquiry failed: %s" / str(e))
        return None
dataset/ETHPy150Open rackerlabs/openstack-guest-agents-unix/commands/freebsd/network.py/get_hostname/operator `%` -> `/`