Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env_variable option in _ADAPTOR_OPTIONS doesn't seem to work #50

Closed
oleweidner opened this issue Mar 13, 2013 · 3 comments
Closed

env_variable option in _ADAPTOR_OPTIONS doesn't seem to work #50

oleweidner opened this issue Mar 13, 2013 · 3 comments

Comments

@oleweidner
Copy link
Contributor

Adaptor options are defined as:

_ADAPTOR_OPTIONS       = [
     {
     'category':      'saga.adaptor.pbsjob',
     'name':          'ptydebug',
     'type':          bool,
     'default':       False,
     'valid_options': [True, False],
     'documentation': """Turns PTYWrapper debugging on or off.""",
     'env_variable':  "SAGA_PTYDEBUG"
     }

If SAGA_PTYDEBUG is not set, the adaptor works fine. However, if it is set, the adaptor loading fails:

2013:03:13 10:19:42 140735128273280 saga.engine           : [ERROR   ] Skipping adaptor saga.adaptors.condor.condorjob: loading failed: 
2013:03:13 10:19:42 140735128273280 saga.engine           : [DEBUG   ]   File "tests/run_tests.py", line 133, in <module>
  File "tests/run_tests.py", line 111, in launch_tests
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/core.py", line 284, in run
    return TestProgram(*arg, **kw).success
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/core.py", line 118, in __init__
    **extra_args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/core.py", line 197, in runTests
    result = self.testRunner.run(self.test)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/core.py", line 61, in run
    test(result)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/suite.py", line 223, in run
    test(orig)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/suite.py", line 223, in run
    test(orig)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/suite.py", line 176, in __call__
    return self.run(*arg, **kw)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/suite.py", line 223, in run
    test(orig)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/case.py", line 45, in __call__
    return self.run(*arg, **kwarg)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/case.py", line 133, in run
    self.runTest(result)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/case.py", line 151, in runTest
    test(result)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 391, in __call__
    return self.run(*args, **kwds)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 327, in run
    testMethod()
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/oweidner/Projects/saga-python/tests/unittests/api/job/test_job.py", line 52, in test_job_service_invalid_url
    js = saga.job.Service(invalid_url, tc.session)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/saga_python-0.9.2-py2.7.egg/saga/utils/test_config.py", line 224, in session
    s = saga.Session (default=False)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/saga_python-0.9.2-py2.7.egg/saga/session.py", line 93, in __init__
    saga.base.SimpleBase.__init__ (self)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/saga_python-0.9.2-py2.7.egg/saga/base.py", line 20, in __init__
    self._engine    = saga.engine.engine.Engine ()
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/saga_python-0.9.2-py2.7.egg/saga/utils/singleton.py", line 21, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/saga_python-0.9.2-py2.7.egg/saga/engine/engine.py", line 148, in __init__
    self._load_adaptors ()
  File "/Users/oweidner/Projects/saga-python/venv/lib/python2.7/site-packages/saga_python-0.9.2-py2.7.egg/saga/engine/engine.py", line 213, in _load_adaptors
    self._logger.trace ()

@andre-merzky
Copy link
Member

fixed now -- this was caused by the config thingie, which (a) did not convert env strings to option target types, and (b) did not initialize parent exception message on errors.

@oleweidner
Copy link
Contributor Author

Seems to work now. However, if I add the following line to ConfigOption.set_value(self, value) in config.py:


        print "SET %s %s" % (self._name, value)

I see the following output for each adaptor:

2013:03:13 13:10:43 140735128273280 saga.engine           : [INFO    ] Loading  adaptor saga.adaptors.sge.sgejob
SET load_beta_adaptors False
SET level 10
SET filters []
SET targets ['STDOUT']
SET ttycolor True
SET enabled True
SET enabled True
SET enabled True
SET enabled True
SET enable_notifications False
SET enabled True

I wonder why 'enabled' shows up so many times?

@andre-merzky
Copy link
Member

I think this is because the config options are re-parsed and re-evaluated
ehenever a configurable class registers a new set of configs -- which is,
for example, whenever an adaptor is loaded.

But you should know better than me -- you wrote that ;-)

A.

On Wed, Mar 13, 2013 at 6:11 PM, Ole Weidner notifications@github.comwrote:

Seems to work now. However, if I add the following line to
ConfigOption.set_value(self, value) in config.py:

    print "SET %s %s" % (self._name, value)

I see the following output for each adaptor:

2013:03:13 13:10:43 140735128273280 saga.engine : [INFO ] Loading adaptor saga.adaptors.sge.sgejob
SET load_beta_adaptors False
SET level 10
SET filters []
SET targets ['STDOUT']
SET ttycolor True
SET enabled True
SET enabled True
SET enabled True
SET enabled True
SET enable_notifications False
SET enabled True

I wonder why 'enabled' shows up so many times?


Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-14854911
.

Nothing is really difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants