Skip to content

Commit

Permalink
cli: activate file seeding
Browse files Browse the repository at this point in the history
* (closes reanahub/reana-server#13).

Signed-off-by: Diego Rodriguez <diego.rodriguez@cern.ch>
  • Loading branch information
Diego Rodriguez committed Nov 1, 2017
1 parent 2b18c7b commit da1666a
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions reana_client/cli/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,27 @@ def inputs_upload(ctx, user, organization, workflow, file_):
if workflow_name:
logging.info('Workflow "{}" selected'.format(workflow_name))
for f in file_:
click.echo('Uploading {} ...'.format(f))

response = True
click.echo('Uploading {} ...'.format(f.name))
try:
response = ctx.obj.client.seed_analysis(
user,
organization,
workflow,
f,
f.name)
if response:
click.echo('File {} was successfully uploaded.'.
format(f.name))

except Exception as e:
logging.debug(str(e))
click.echo(
click.style(
'Something went wrong while uploading {0}'.
format(f.name),
fg='red'),
err=True)

if response:
click.echo('File {} was successfully uploaded.'.format(f))
else:
click.echo(
click.style('Workflow name must be provided either with '
Expand All @@ -141,17 +156,6 @@ def inputs_upload(ctx, user, organization, workflow, file_):
fg='red'),
err=True)

# try:
# response = ctx.obj.client.seed_analysis(
# user,
# organization,
# workflow,
# file_,
# file_.name)
# click.echo(response)

# except Exception as e:
# logging.debug(str(e))

inputs.add_command(inputs_list)
inputs.add_command(inputs_upload)

0 comments on commit da1666a

Please sign in to comment.