def parse_hosts()

in lib/muchos/config/base.py [0:0]


    def parse_hosts(self):
        if not isfile(self.hosts_path):
            exit(
                "ERROR - A hosts file does not exist at {}".format(
                    self.hosts_path
                )
            )

        self.hosts = {}
        with open(self.hosts_path) as f:
            for line in f:
                line = line.strip()
                if line.startswith("#") or not line:
                    continue
                args = line.split(" ")
                if len(args) == 2:
                    self.hosts[args[0]] = (args[1], None)
                elif len(args) == 3:
                    self.hosts[args[0]] = (args[1], args[2])
                else:
                    exit(
                        "ERROR - Bad line {} in hosts {}".format(
                            line, self.hosts_path
                        )
                    )