diff options
author | Jerome Martin <jxm@risingtidesystems.com> | 2012-05-08 16:52:39 +0200 |
---|---|---|
committer | Jerome Martin <jxm@risingtidesystems.com> | 2012-05-08 16:57:34 +0200 |
commit | f403737c41bfc326eba7e2e6c0796020df9c1a1b (patch) | |
tree | 248aa44424d24c2745f8da5d2c764404fbe8f5d7 | |
parent | 5cfc547dbe1f593540cd8af4f9a217eab9dec8f7 (diff) | |
download | targetcli-f403737c41bfc326eba7e2e6c0796020df9c1a1b.tar.gz |
Fixed wrong exception check in luns/ create
* When trying to create a new LUN with a bad storage object, a stack trace was
being dumped.
-rw-r--r-- | targetcli/ui_target.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py index ea1411f..308bdea 100644 --- a/targetcli/ui_target.py +++ b/targetcli/ui_target.py @@ -720,8 +720,9 @@ class UILUNs(UINode): try: storage_object = self.get_node(storage_object).rtsnode - except AttributeError: - self.shell.log.error("Wrong storage object path.") + except ValueError: + self.shell.log.error("Invalid storage object %s." % storage_object) + return lun_object = LUN(self.tpg, lun, storage_object) self.shell.log.info("Successfully created LUN %s." % lun_object.lun) |