diff options
author | Andy Grover <agrover@redhat.com> | 2014-04-15 11:53:50 -0700 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2014-04-15 11:53:50 -0700 |
commit | e07dc0d9714699335ba9c356adae21b9aca2fb38 (patch) | |
tree | 0254894becf64db6d493eb27318aba8ebb6be71a | |
parent | 8a8e20f4f6c6cad6a0b11e7d2d8a8040b75ccaf0 (diff) | |
download | rtslib-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.py | 12 |
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): ''' |