* [PATCH] nvmetcli: port decoration coloring only if its enabled
@ 2017-12-05 11:48 Sagi Grimberg
2017-12-05 12:26 ` Johannes Thumshirn
2017-12-06 22:48 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Sagi Grimberg @ 2017-12-05 11:48 UTC (permalink / raw)
Only color the port if its enabled (has subsystems or
referrals symlinks).
Also, don't display none trsvcid (like in the fc case).
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
nvmetcli | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/nvmetcli b/nvmetcli
index ead6429d5be5..6b102a235450 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -382,10 +382,13 @@ class UIPortNode(UINode):
def summary(self):
info = []
- info.append("traddr=" + self.cfnode.get_attr("addr", "traddr"))
- info.append("trsvcid=" + self.cfnode.get_attr("addr", "trsvcid"))
info.append("trtype=" + self.cfnode.get_attr("addr", "trtype"))
- return (", ".join(info), True)
+ info.append("traddr=" + self.cfnode.get_attr("addr", "traddr"))
+ trsvcid = self.cfnode.get_attr("addr", "trsvcid")
+ if trsvcid != "none":
+ info.append("trsvcid=%s" % trsvcid)
+ enabled = not (not self.cfnode.subsystems and not list(self.cfnode.referrals))
+ return (", ".join(info), True if enabled else 0)
class UIPortSubsystemsNode(UINode):
def __init__(self, parent):
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] nvmetcli: port decoration coloring only if its enabled
2017-12-05 11:48 [PATCH] nvmetcli: port decoration coloring only if its enabled Sagi Grimberg
@ 2017-12-05 12:26 ` Johannes Thumshirn
2017-12-06 22:48 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-12-05 12:26 UTC (permalink / raw)
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
--
Johannes Thumshirn Storage
jthumshirn at suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] nvmetcli: port decoration coloring only if its enabled
2017-12-05 11:48 [PATCH] nvmetcli: port decoration coloring only if its enabled Sagi Grimberg
2017-12-05 12:26 ` Johannes Thumshirn
@ 2017-12-06 22:48 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2017-12-06 22:48 UTC (permalink / raw)
Thanks, applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-06 22:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 11:48 [PATCH] nvmetcli: port decoration coloring only if its enabled Sagi Grimberg
2017-12-05 12:26 ` Johannes Thumshirn
2017-12-06 22:48 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.