"""Infrastructure handling module.""" import os from autonomic.settings import MEMBERS_YAML from autonomic.system import exit_with_msg from autonomic.yaml import yaml def get_members(): """Get list of Autonomic members.""" if not os.path.exists(MEMBERS_YAML): msg = "{} is missing, run: autonomic init".format(MEMBERS_YAML) exit_with_msg(msg) with open(MEMBERS_YAML, "r") as handle: try: return yaml.load(handle.read()) except Exception as exception: exit_with_msg(str(exception))