projects
/
invirt/packages/invirt-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
86c5d9c
)
Rename InvirtException to more descriptive PathResolutionException
author
Ben Steffen
<bds@mit.edu>
Tue, 26 Nov 2019 17:08:56 +0000
(12:08 -0500)
committer
Ben Steffen
<bds@mit.edu>
Tue, 26 Nov 2019 17:08:56 +0000
(12:08 -0500)
scripts/invirt-getconf
patch
|
blob
|
history
diff --git
a/scripts/invirt-getconf
b/scripts/invirt-getconf
index
b0a1896
..
07e475b
100755
(executable)
--- a/
scripts/invirt-getconf
+++ b/
scripts/invirt-getconf
@@
-23,7
+23,7
@@
import yaml
import invirt
import invirt
-class InvirtException(Exception):
+class PathResolutionException(Exception):
pass
pass
@@
-45,22
+45,20
@@
def main():
try:
component = int(component)
except ValueError:
try:
component = int(component)
except ValueError:
- raise InvirtException(f'{progress}: node a list; integer path component required, '
+ raise PathResolutionException(f'{progress}: node is a list; integer path component required, '
'but got "{component}"')
try:
conf = conf[component]
except IndexError:
'but got "{component}"')
try:
conf = conf[component]
except IndexError:
- raise InvirtException(f'{progress}: index {component} out of range')
+ raise PathResolutionException(f'{progress}: index {component} out of range')
elif isinstance(conf, dict):
try:
conf = conf[component]
except KeyError:
elif isinstance(conf, dict):
try:
conf = conf[component]
except KeyError:
- raise InvirtException(f'{progress}: key "{component}" not found')
- except IndexError:
- raise InvirtException(f'{progress}: index {component} out of range')
+ raise PathResolutionException(f'{progress}: key "{component}" not found')
else:
else:
- raise InvirtException(f'{progress}: node has no children (atomic datum)')
+ raise PathResolutionException(f'{progress}: node has no children (atomic datum)')
if args.ls:
if isinstance(conf, list):
if args.ls:
if isinstance(conf, list):
@@
-70,7
+68,7
@@
def main():
for k in conf:
print(k)
else:
for k in conf:
print(k)
else:
- raise InvirtException(f'{".".join(components)}: node has no children (atomic datum)')
+ raise PathResolutionException(f'{".".join(components)}: node has no children (atomic datum)')
else:
if isinstance(conf, (dict, list)):
print(conf)
else:
if isinstance(conf, (dict, list)):
print(conf)