summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2014-01-08 15:27:21 -0800
committerAndy Grover <agrover@redhat.com>2014-01-08 15:27:21 -0800
commit2be01f39ca38c456f9aa00c0e373a37a2065abed (patch)
treedbef91fb088a08330e310edea9f7795da5259236
parent73ab07ec25655dcb2288029690db388c314a1dcc (diff)
downloadtargetcli-2be01f39ca38c456f9aa00c0e373a37a2065abed.tar.gz
Print a warning if creating a HW-based target for absent WWN
It is possible to create targets for hardware-based targets using WWNs that are not in the fabric's WWN list. However, if the user is creating one of these, print a warning, because if the user doesn't expect this (e.g. made a typo from an existing hw WWN) then things won't work and it may not be clear why. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--targetcli/ui_target.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/targetcli/ui_target.py b/targetcli/ui_target.py
index 7919c89..d66f10c 100644
--- a/targetcli/ui_target.py
+++ b/targetcli/ui_target.py
@@ -180,6 +180,9 @@ class UIFabricModule(UIRTSLibNode):
target = Target(self.rtsnode, wwn, mode='create')
wwn = target.wwn
+ if self.rtsnode.wwns != None and wwn not in self.rtsnode.wwns:
+ self.shell.log.warning("Hardware missing for this WWN")
+
if target.has_feature('tpgts'):
ui_target = UIMultiTPGTarget(target, self)
self.shell.log.info("Created target %s." % wwn)