summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-05-30 13:20:49 -0700
committerAndy Grover <agrover@redhat.com>2013-05-30 13:20:49 -0700
commitefc8b5d0f0801bed0e5b69624adfa7cd25a366ec (patch)
tree617d75da1b93617e73bd969237919deb6055a0cf
parentd51cd1520e0cc970767e1404b1a5059d0a685150 (diff)
downloadrtslib-fb-efc8b5d0f0801bed0e5b69624adfa7cd25a366ec.tar.gz
Don't allow reading wwn from unconfigured SOs
I don't think anybody does this but if they try, they should have to catch the exception. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/tcm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rtslib/tcm.py b/rtslib/tcm.py
index 85bbc08..185db6b 100644
--- a/rtslib/tcm.py
+++ b/rtslib/tcm.py
@@ -87,7 +87,8 @@ class StorageObject(CFSNode):
path = "%s/wwn/vpd_unit_serial" % self.path
return fread(path).partition(":")[2].strip()
else:
- return ""
+ raise RTSLibError("Cannot read a T10 WWN Unit Serial from "
+ + "an unconfigured StorageObject.")
def _set_wwn(self, wwn):
self._check_self()