hpcugent / vsc-base

Basic Python libraries used by UGent's HPC group
Other
14 stars 51 forks source link

Use '--opt=val' for passing options from config file to generaloption #308

Closed wpoely86 closed 3 years ago

wpoely86 commented 3 years ago

This should fix #307

I will add a test.

stdweird commented 3 years ago

@wpoely86 looks ok. now lets grab some :popcorn: to see why it was written like that :wink:

stdweird commented 3 years ago

internal options have - converted to _

======================================================================

ERROR: test_configfiles (test.generaloption.GeneralOptionTest)

Test configfiles (base section for empty prefix from auto_section_name)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/var/lib/jenkins/jobs/hpcugent_github.com/jobs/vsc-base/branches/PR-308/workspace/test/generaloption.py", line 555, in test_configfiles

    topt = TestOption1(go_configfiles=[tmp1.name], go_args=[])

  File "lib/vsc/utils/generaloption.py", line 1000, in __init__

    self.parseconfigfiles()

  File "lib/vsc/utils/generaloption.py", line 1423, in parseconfigfiles

    'opt %s dest %s in section %s') % (opt, opt_dest, section))

  File "lib/vsc/utils/fancylogger.py", line 346, in raiseException

    raise_with_traceback(exception(message))

  File "/var/lib/jenkins/jobs/hpcugent_github.com/jobs/vsc-base/branches/PR-308/workspace/.eggs.py3/future-0.18.2-py3.6.egg/future/utils/__init__.py", line 446, in raise_with_traceback

    raise exc.with_traceback(traceback)

Exception: parseconfigfiles: no option corresponding with opt dash-option1 dest dash_option1 in section base
wpoely86 commented 3 years ago

Thanks!

I hope the :popcorn: will not be needed later today when I actually start using it :wink: