Skip to content

Commit

Permalink
Fix bug related to missing params. (#2929)
Browse files Browse the repository at this point in the history
* Fix bug, not checking every data set for validiness.

* Fix iffy.

* Add unit test.

* Fix bug related to missing params.

* Fix spacing.

* Fix error related to type string.

* add comments about valueerror.

* Fix valueError.

* Fix grammar.
  • Loading branch information
jkmarx committed Aug 3, 2018
1 parent e51e6c1 commit bebec6e
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions refinery/data_set_manager/management/commands/process_isatab.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ class Command(BaseCommand):
"""

def add_arguments(self, parser):
parser.add_argumenet(
parser.add_argument('username')
parser.add_argument('base_isa_dir')
parser.add_argument(
'--base_pre_isa_dir',
action='store',
type='string'
)
parser.add_argumenet(
parser.add_argument(
'--file_base_path',
action='store',
type='string',
default=None
)
parser.add_argumenet(
parser.add_argument(
'--public',
action='store_true',
default=False
)
parser.add_argumenet(
parser.add_argument(
'--overwrite',
action='store_true',
default=False
Expand Down Expand Up @@ -123,28 +123,22 @@ def handle(self, username, base_isa_dir, **options):

task_num = 1
total = len(isatab_dict)
for (uuid, filename, skipped) in result.iterate():
for uuid in result.iterate():
try:
if not skipped:
if uuid is not None:
logger.info(
"%s / %s: Successfully parsed %s into "
"DataSet with UUID %s",
task_num, total, filename, uuid)
else:
logger.info(
"%s / %s: Import of %s failed. Please check "
"Celery log files.",
task_num, total, filename, uuid)
if uuid is not None:
logger.info(
"%s / %s: Successfully parsed file into "
"DataSet with UUID %s",
task_num, total, uuid)
else:
logger.info(
"%s / %s: Skipped %s as it has been "
"successfully parsed already. UUID %s",
task_num, total, filename, uuid)
"%s / %s: Import of %s failed. Please check "
"Celery log files.",
task_num, total, uuid)
task_num += 1
sys.stdout.flush()
except:
logger.info("%s / %s: Unsuccessful parsed %s",
task_num, total, filename)
logger.info("%s / %s: Unsuccessfully parsed",
task_num, total)
task_num += 1
sys.stdout.flush()

0 comments on commit bebec6e

Please sign in to comment.