def __init__(self, blueprint, blueprint_path="./"): logger.debug("Creating blueprint from data: %s", blueprint) try: self.blueprint = yaml.safe_load(blueprint) except yaml.YAMLError as exc: logger.error("Error parsing blueprint: %s", exc) raise exc self.blueprint_path = blueprint_path if not self.blueprint: self.blueprint = {}
def __init__(self, config): with open(config, 'r') as stream: try: self.config = yaml.safe_load(stream) except yaml.YAMLError as exc: logger.error("Error parsing config: %s", exc) raise exc self.config_path = os.path.dirname(config) if not self.config_path: self.config_path = "./" self.config_filename = config
def __init__(self, config): with open(config, 'r') as stream: try: self.config = yaml.load(stream) except yaml.YAMLError as exc: logger.error("Error parsing config: %s", exc) raise exc self.config_path = os.path.dirname(config) if not self.config_path: self.config_path = "./" self.config_filename = config image_name = self.config.get("save", {}).get("name") if not image_name: raise BadConfigurationException( "Missing required configuration option \"save.name\" in config file: %s" % ( self.config_filename))