Пример #1
0
 def read_deployment_info(self, fact_type, directory=os.path.curdir):
     dir_name = self._get_fact_dir_name(fact_type, directory=directory)
     return map(
         lambda f: self.serializer.read_from_file(f),
         [os.path.join(dir_name, json_file)
          for json_file in listdir_without_extensions(dir_name)]
     )
Пример #2
0
 def read_deployment_info(self, fact_type,
                          directory=os.path.curdir, serializer=None):
     dir_name = self._get_fact_dir_name(fact_type, directory=directory)
     return map(
         lambda f: (serializer or self.serializer).read_from_file(f),
         [os.path.join(dir_name, json_file)
          for json_file in listdir_without_extensions(dir_name)]
     )
Пример #3
0
 def read_provisioning_info(self,
                            fact_type,
                            directory=os.path.curdir,
                            serializer=None):
     dir_name = self._get_fact_dir_name(fact_type, directory=directory)
     node_facts = map(
         lambda f: (serializer or self.serializer).read_from_file(f), [
             os.path.join(dir_name, fact_file)
             for fact_file in listdir_without_extensions(dir_name)
             if "engine" != fact_file
         ])
     engine = (serializer or self.serializer).read_from_file(
         os.path.join(dir_name, "engine"))
     return {"engine": engine, "nodes": node_facts}
Пример #4
0
 def read_provisioning_info(self, fact_type, directory=os.path.curdir):
     dir_name = self._get_fact_dir_name(fact_type, directory=directory)
     node_facts = map(
         lambda f: self.serializer.read_from_file(f),
         [os.path.join(dir_name, fact_file)
          for fact_file in listdir_without_extensions(dir_name)
          if "engine" != fact_file]
     )
     engine = self.serializer.read_from_file(
         os.path.join(dir_name, "engine"))
     return {
         "engine": engine,
         "nodes": node_facts
     }