Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 25, 2022
1 parent 15d51c9 commit ce6c672
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions deployer/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,14 @@ def deploy(self, auth_provider, secret_key, skip_hub_health_test=False):
for values_file in self.spec["helm_chart_values_files"]:
check_file_exists(self.config_path.joinpath(values_file))
if values_file.startswith("enc-") or ("secret" in values_file):
with verify_and_decrypt_file(self.config_path.joinpath(values_file)) as decrypted_file:
with verify_and_decrypt_file(
self.config_path.joinpath(values_file)
) as decrypted_file:
values_files.append(f"--values={decrypted_file}")
else:
values_files.append(f"--values={self.config_path.joinpath(values_file)}")
values_files.append(
f"--values={self.config_path.joinpath(values_file)}"
)

# Check if this cluster has any secret config. If yes, read it in.
# secret_config_path = Path(os.getcwd()).joinpath(
Expand Down Expand Up @@ -575,7 +579,7 @@ def deploy(self, auth_provider, secret_key, skip_hub_health_test=False):
)

with tempfile.NamedTemporaryFile(mode="w") as generated_values_file:
#, tempfile.NamedTemporaryFile(mode="w") as secret_values_file:
# , tempfile.NamedTemporaryFile(mode="w") as secret_values_file:
json.dump(generated_values, generated_values_file)
generated_values_file.flush()
# json.dump(secret_hub_config, secret_values_file)
Expand Down
6 changes: 4 additions & 2 deletions deployer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def check_file_exists(filepath):
filepath (str): Absolute path to the file that is to be checked for existence
"""
if not os.path.exists(filepath):
raise FileNotFoundError(f"""
raise FileNotFoundError(
f"""
File Not Found at following location! Have you checked it's the correct path?
{filepath}
""")
"""
)


def find_absolute_path_to_cluster_file(cluster_name: str):
Expand Down

0 comments on commit ce6c672

Please sign in to comment.