def load_terraform_output_from_json_file(cls): tf_output_file = get_terraform_latest_output_file() output_dict = {} if os.path.exists(tf_output_file): with open(tf_output_file) as jsonfile: output_dict = json.load(jsonfile) return output_dict
def save_terraform_output(cls): tf_output_file = get_terraform_latest_output_file() output_dict = cls.load_terraform_output() with open(tf_output_file, 'w') as jsonfile: json.dump(output_dict, jsonfile, indent=4) cls.log_obj.write_debug_log(K.TERRAFORM_OUTPUT_STORED) return output_dict
def load_terraform_output_from_json_file(cls): """ Load terraform output form the output file Returns: output_dict (dict): Terraform output """ tf_output_file = get_terraform_latest_output_file() output_dict = {} if os.path.exists(tf_output_file): with open(tf_output_file) as jsonfile: output_dict = json.load(jsonfile) return output_dict
def delete_terraform_output_json_file(cls): tf_output_file = get_terraform_latest_output_file() if os.path.isfile(tf_output_file): os.remove(tf_output_file)