Exemplo n.º 1
0
 def __get_version_from_package(self, service):
     """
     Check RackHD version from package.json file
     """
     package_file_path = os.path.join(self.source_code_path, service, "package.json")
     result = utils.robust_load_json_file(package_file_path)
     version = result["message"].get("version")
     if not result["exit_code"] and version:
         result["message"] = version
     return result
Exemplo n.º 2
0
 def load_config_template(self):
     """
     Load RackHD configure template file
     """
     result = utils.robust_load_json_file(self.template_file_path)
     if result["exit_code"]:
         description = "Load RackHD configure file {}".format(self.template_file_path)
         Logger.record_command_result(description, "error", result)
     else:
         self.rackhd_config_template = result["message"]
Exemplo n.º 3
0
 def __get_version_from_package(self, service):
     """
     Check RackHD version from package.json file
     """
     package_file_path = os.path.join(self.source_code_path, service, "package.json")
     result = utils.robust_load_json_file(package_file_path)
     version = result["message"].get("version")
     if not result["exit_code"] and version:
         result["message"] = version
     return result
Exemplo n.º 4
0
 def load_config_template(self):
     """
     Load RackHD configure template file
     """
     result = utils.robust_load_json_file(self.template_file_path)
     if result["exit_code"]:
         description = "Load RackHD configure file {}".format(self.template_file_path)
         Logger.record_command_result(description, "error", result)
     else:
         self.rackhd_config_template = result["message"]
Exemplo n.º 5
0
 def load_config_file(self):
     """
     Load RackHD configures
     """
     for path in self.config_file_paths:
         result = utils.robust_load_json_file(path)
         if not result["exit_code"]:
             self.rackhd_config = result["message"]
             self.unchecked_configs = self.rackhd_config.keys()
             result["message"] = ""
             break
     description = "Load RackHD configure file"
     Logger.record_command_result(description, "error", result)
Exemplo n.º 6
0
 def load_config_file(self):
     """
     Load RackHD configures
     """
     for path in self.config_file_paths:
         result = utils.robust_load_json_file(path)
         if not result["exit_code"]:
             self.rackhd_config = result["message"]
             self.unchecked_configs = self.rackhd_config.keys()
             result["message"] = ""
             break
     description = "Load RackHD configure file"
     Logger.record_command_result(description, "error", result)