diff options
author | Andy Grover <agrover@redhat.com> | 2013-05-30 13:20:49 -0700 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2013-05-30 13:20:49 -0700 |
commit | efc8b5d0f0801bed0e5b69624adfa7cd25a366ec (patch) | |
tree | 617d75da1b93617e73bd969237919deb6055a0cf | |
parent | d51cd1520e0cc970767e1404b1a5059d0a685150 (diff) | |
download | rtslib-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.py | 3 |
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() |