]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
nvmetcli: simplify the enabled logic
authorChristoph Hellwig <hch@lst.de>
Sat, 6 Oct 2018 12:31:49 +0000 (14:31 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 6 Oct 2018 12:39:41 +0000 (14:39 +0200)
pep8 complains about the overlong line, and this can be simplied
by transforming the boolean logic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
nvmetcli

index 03a1e9f30a7a1b91fede32f9cc4311a87e685d69..824236485474727909cf48a4183956d78cc555df 100755 (executable)
--- a/nvmetcli
+++ b/nvmetcli
@@ -404,7 +404,7 @@ class UIPortNode(UINode):
             inline_data_size = "n/a"
         if inline_data_size != "n/a":
             info.append("inline_data_size=" + inline_data_size)
-        enabled = not (not self.cfnode.subsystems and not list(self.cfnode.referrals))
+        enabled = self.cfnode.subsystems or list(self.cfnode.referrals)
         return (", ".join(info), True if enabled else 0)