Skip to content

Commit 9646479

Browse files
committed
added config + cli functionality to module upload_results
1 parent 0c8678a commit 9646479

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

relecov_tools/__main__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ def wrapper(ctx, config_file, output_folder):
10581058
else:
10591059
sys.exit(f"EXCEPTION FOUND: {e}")
10601060

1061-
1061+
# upload_results
10621062
@relecov_tools_cli.command(help_priority=17)
10631063
@click.option("-u", "--user", help="User name for login to sftp server")
10641064
@click.option("-p", "--password", help="password for the user to login")
@@ -1075,10 +1075,9 @@ def wrapper(ctx, config_file, output_folder):
10751075
@click.pass_context
10761076
def upload_results(ctx, user, password, batch_id, template_path, project):
10771077
"""Upload batch results to sftp server."""
1078+
args_merged = merge_with_extra_config(ctx=ctx, add_extra_config=True)
10781079
debug = ctx.obj.get("debug", False)
1079-
upload_sftp = relecov_tools.upload_results.UploadSftp(
1080-
user, password, batch_id, template_path, project
1081-
)
1080+
upload_sftp = relecov_tools.upload_results.UploadSftp(**args_merged)
10821081
try:
10831082
upload_sftp.execute_process()
10841083
except Exception as e:

relecov_tools/upload_results.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class UploadSftp(BaseModule):
2323
def __init__(
2424
self,
2525
user=None,
26-
passwd=None,
26+
password=None,
2727
batch_id=None,
2828
template_path=None,
2929
project="Relecov",
@@ -57,7 +57,7 @@ def __init__(
5757
self.sftp_user = user or relecov_tools.utils.prompt_text(
5858
msg="Enter the user id:"
5959
)
60-
self.sftp_passwd = passwd or relecov_tools.utils.prompt_password(
60+
self.sftp_passwd = password or relecov_tools.utils.prompt_password(
6161
msg="Enter your password:"
6262
)
6363

0 commit comments

Comments
 (0)