def validate(self, obj): """Base validation method. Will inspect class attributes to dermine just what should be present""" if 'tags' in obj and not isinstance(obj['tags'], list): raise aomi_excep.Validation('tags must be a list') if self.present: check_obj(self.required_fields, self.name(), obj)
def validate(self, obj): """Base validation method. Will inspect class attributes to dermine just what should be present""" if 'tags' in obj and not isinstance(obj['tags'], list): raise aomi.exceptions.Validation('tags must be a list') if self.present: check_obj(self.required_fields, self.name(), obj)
def obj(self): _secret, filename, region = self._obj actual_filename = hard_path(filename, self.opt.secrets) secret_file(actual_filename) aws_obj = yaml.safe_load(open(actual_filename, 'r').read()) check_obj(['access_key_id', 'secret_access_key'], self, aws_obj) return { 'access_key': aws_obj['access_key_id'], 'secret_key': aws_obj['secret_access_key'], 'region': region }
def obj(self): _secret, filename, region = self._obj actual_filename = hard_path(filename, self.opt.secrets) secret_file(actual_filename) template_obj = load_vars(self.opt) aws_obj = load_var_file(actual_filename, template_obj) check_obj(['access_key_id', 'secret_access_key'], self, aws_obj) return { 'access_key': aws_obj['access_key_id'], 'secret_key': aws_obj['secret_access_key'], 'region': region }
def obj(self): _secret, filename, region = self._obj actual_filename = hard_path(filename, self.opt.secrets) secret_file(actual_filename) template_obj = load_vars(self.opt) aws_obj = load_var_file(actual_filename, template_obj) check_obj(['access_key_id', 'secret_access_key'], self, aws_obj) return { 'access_key': aws_obj['access_key_id'], 'secret_key': aws_obj['secret_access_key'], 'region': region }
def validate(self, obj): super(Files, self).validate(obj) for fileobj in obj['files']: check_obj(['source', 'name'], self.name(), fileobj)
def __init__(self, obj, opt): super(Generated, self).__init__(obj['generated'], opt) for key in obj['generated']['keys']: check_obj(['name', 'method'], 'generated secret entry', key) self.keys = obj['generated']['keys']
def validate(self, obj): super(Files, self).validate(obj) for fileobj in obj['files']: check_obj(['source', 'name'], self.name(), fileobj)
def __init__(self, obj, opt): super(Generated, self).__init__(obj['generated'], opt) for key in obj['generated']['keys']: check_obj(['name', 'method'], 'generated secret entry', key) self.keys = obj['generated']['keys']