Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: pex_config
-
Labels:None
-
Story Points:0.5
-
Epic Link:
-
Sprint:DRP X16-2
-
Team:Data Release Production
Description
Within a config override file being executed via Config.load or Config.loadFromStream, using a variable that hasn't been defined results in a NameError exception, but this is silently suppressed and the user has no idea the following overrides have not been executed.
Attachments
Issue Links
Activity
Field | Original Value | New Value |
---|---|---|
Reviewers | Russell Owen [ rowen ] | |
Status | To Do [ 10001 ] | In Review [ 10004 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Epic Link |
|
Sprint | DRP X16-2 [ 214 ] | |
Story Points | 0.5 | |
Team | Data Release Production [ 10301 ] | |
Issue Type | Story [ 10001 ] | Bug [ 1 ] |
Status | In Review [ 10004 ] | Reviewed [ 10101 ] |
Resolution | Done [ 10000 ] | |
Status | Reviewed [ 10101 ] | Done [ 10002 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
Remote Link | This issue links to "Page (Confluence)" [ 13614 ] | This issue links to "Page (Confluence)" [ 13614 ] |
A real easy review, please Russell Owen:
pprice@tiger-sumire:/tigress/pprice/dm-5124/pex_config (tickets/DM-5729=) $ git sub-patch
commit c8eb449e2a30d86a236151899ea0463239fb826d
Author: Paul Price <price@astro.princeton.edu>
Date: Wed Apr 6 12:32:02 2016 -0400
allow NameError in loading to propagate
NameError was being unintentionally suppressed (we want to suppress
it to catch the root->config change, but there are other cases where
it needs to propagate or the user will be blissfully ignorant of
errors). Added a test that demonstrates the problem.
diff --git a/python/lsst/pex/config/config.py b/python/lsst/pex/config/config.py
index 8960825..9add5d9 100644
--- a/python/lsst/pex/config/config.py
+++ b/python/lsst/pex/config/config.py
@@ -562,6 +562,8 @@ class Config(object):
" appears to use 'root' instead of 'config'; trying with 'root'")
local = {"root": self}
exec stream in {}, local
+ else:
+ raise
self._imports.update(importer.getModules())
diff --git a/tests/config.py b/tests/config.py
index 5182e3b..99661aa 100755
--- a/tests/config.py
+++ b/tests/config.py
@@ -391,6 +391,12 @@ except ImportError:
self.assert_("Inequality in r['AAA']" in output)
self.assert_("Inequality in r['BBB']" not in output)
+ def testLoadError(self):
+ """Check that loading allows errors in the file being loaded to propagate
+ """
+ self.assertRaises(SyntaxError, self.simple.loadFromStream, "bork bork bork")
+ self.assertRaises(NameError, self.simple.loadFromStream, "config.f = bork")
+
def suite():
utilsTests.init()
suites = []