Ejemplo n.º 1
0
	def get_all_yamls(self):

		if len(self.yamls) == 0:
			logging.debug('getting all yamls for host %s' % self.name)
			inicio = start_counter()
			for yaml in self.yamlfiles:
				util.load_yaml(yaml)
			elapsed(inicio)
		else:
			logging.debug("yamls returned from cache")
		
		return self.yamls
Ejemplo n.º 2
0
	def get_yaml(self, yamlfile):
		#return self.load_yaml(yamlfile)
		logging.debug('getting yamlfile %s' % yamlfile)
		inicio = util.start_counter()
		yaml_content = {}
		if yamlfile.endswith(".yaml"):
			yaml_content = cache.get(yamlfile)
			if not yaml_content:
				logging.debug('yamlfile %s not cached' % yamlfile)
				yaml_content = util.load_yaml(self.reportdir + '/' + self.name + '/' + yamlfile)
				cache.set(yamlfile, yaml_content)
			else:
				logging.debug('yamlfile %s returned from cache' % yamlfile)
				
			self.yamls.append(yaml_content)
		util.elapsed(inicio)
		return yaml_content
Ejemplo n.º 3
0
	def loadFacts(self):
		yamlfile = settings.YAMLDIR + "/facts/" + self.name + ".yaml"
		return util.load_yaml(yamlfile)