Ejemplo n.º 1
0
 def run_process(self,
                 no_existing_file_expected,
                 file_exists,
                 overwrite=False):
     self.exists.return_value = file_exists
     env_file.process_no_existing_file_expectation(
         "role", {
             "no_existing_file_expected": no_existing_file_expected,
             "can_overwrite_existing_file": overwrite,
         }, FILE_PATH)
Ejemplo n.º 2
0
 def run_process(
     self, no_existing_file_expected, file_exists, overwrite=False
 ):
     self.exists.return_value = file_exists
     env_file.process_no_existing_file_expectation(
         "role",
         {
             "no_existing_file_expected": no_existing_file_expected,
             "can_overwrite_existing_file": overwrite,
         },
         FILE_PATH
     )
Ejemplo n.º 3
0
Archivo: env.py Proyecto: junaruga/pcs
    def flush(modified_env):
        if not is_mocked_environment:
            return
        if not modified_env:
            #TODO now this would not happen
            #for more information see comment in
            #pcs.cli.common.lib_wrapper.lib_env_to_cli_env
            raise console_report.error("Error during library communication")

        env_file.process_no_existing_file_expectation(
            "booth config file", modified_env["config_file"], config_path)
        env_file.process_no_existing_file_expectation("booth key file",
                                                      modified_env["key_file"],
                                                      key_path)
        env_file.write(modified_env["key_file"], key_path)
        env_file.write(modified_env["config_file"], config_path)
Ejemplo n.º 4
0
    def flush(modified_env):
        if not is_mocked_environment:
            return
        if not modified_env:
            #TODO now this would not happen
            #for more information see comment in
            #pcs.cli.common.lib_wrapper.lib_env_to_cli_env
            raise console_report.error("Error during library communication")

        env_file.process_no_existing_file_expectation(
            "booth config file",
            modified_env["config_file"],
            config_path
        )
        env_file.process_no_existing_file_expectation(
            "booth key file",
            modified_env["key_file"],
            key_path
        )
        env_file.write(modified_env["key_file"], key_path)
        env_file.write(modified_env["config_file"], config_path)