def get_local_hostname() -> str:
    """
    A function to get the information from /etc/hostname
    :return: string. Hostname
    """
    hostname_path = "/etc/hostname"
    with open(hostname_path) as f:
        try:
            s = f.readlines()
            return s[0].strip()
        except IOError:
            raise IOError("Error opening {}".format(hostname_path))