Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Adjusting to RKD 2.1.3 - defined_args support
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Aug 17, 2020
1 parent 5fc962c commit 260e2ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rkd_harbor/tasks/deployment/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _get_vault_opts(self, ctx: ExecutionContext, chdir: str = '') -> str:
self.io().error('Vault password file "%s" does not exist, calling --ask-vault-pass' % passwd)
enforce_ask_pass = True
else:
tmp_vault_file = self.temp.assign_temporary_file()
tmp_vault_file = self.temp.assign_temporary_file(mode=0o644)

with open(tmp_vault_file, 'w') as f:
f.write(passwd)
Expand Down
8 changes: 7 additions & 1 deletion src/rkd_harbor/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,18 @@ def execute_task(self, task: TaskInterface, args: dict = {}, env: dict = {}) ->
r_io = IO()
str_io = StringIO()

defined_args = {}

for arg, arg_value in args.items():
defined_args[arg] = {'default': ''}

with r_io.capture_descriptors(enable_standard_out=True, stream=str_io):
try:
result = task.execute(ExecutionContext(
TaskDeclaration(task),
args=args,
env=merged_env
env=merged_env,
defined_args=defined_args
))
except Exception:
print(ctx.io.get_value() + "\n" + str_io.getvalue())
Expand Down

0 comments on commit 260e2ed

Please sign in to comment.