summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2014-04-15 11:53:50 -0700
committerAndy Grover <agrover@redhat.com>2014-04-15 11:53:50 -0700
commite07dc0d9714699335ba9c356adae21b9aca2fb38 (patch)
tree0254894becf64db6d493eb27318aba8ebb6be71a
parent8a8e20f4f6c6cad6a0b11e7d2d8a8040b75ccaf0 (diff)
downloadrtslib-fb-e07dc0d9714699335ba9c356adae21b9aca2fb38.tar.gz
Convert all exceptions in set_parameter/attribute to RTSLibError
Also remove unneeded conversions. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/node.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/rtslib/node.py b/rtslib/node.py
index 8f5aa15..99245a2 100644
--- a/rtslib/node.py
+++ b/rtslib/node.py
@@ -138,10 +138,8 @@ class CFSNode(object):
else:
try:
fwrite(path, "%s" % str(value))
- except IOError as msg:
- msg = msg[1]
- raise RTSLibError("Cannot set attribute %s: %s"
- % (str(attribute), str(msg)))
+ except Exception as e:
+ raise RTSLibError("Cannot set attribute %s: %s" % (attribute, e))
def get_attribute(self, attribute):
'''
@@ -173,10 +171,8 @@ class CFSNode(object):
else:
try:
fwrite(path, "%s\n" % str(value))
- except IOError as msg:
- msg = msg[1]
- raise RTSLibError("Cannot set parameter %s: %s"
- % (str(parameter), str(msg)))
+ except Exception as e:
+ raise RTSLibError("Cannot set attribute %s: %s" % (attribute, e))
def get_parameter(self, parameter):
'''