]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
nvmetcli: fix Referral operation in shell
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Mon, 27 Mar 2017 17:46:44 +0000 (14:46 -0300)
committerChristoph Hellwig <hch@lst.de>
Thu, 30 Mar 2017 08:26:43 +0000 (10:26 +0200)
It's not possible to create or list a Referral under Port entity,
because Referral class is not imported and thus it fails:

/ports/1/referrals> ls

returning "'module' object has no attribute 'Referral'".

This is caused by changes introduced in:
a21ebd54f0 ("nvmetcli: Fix nvmet import").

This patch also fixes the attribute type helper expected for Referral's
portid attribute. It was 'int', causing the system to show error
messages like:

"'UIReferralNode' object has no attribute 'ui_type_int'".
The correct type is 'number'.

Reviewed-by: Guilherme G. Piccoli<gpiccoli@linux.vnet.ibm.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
nvmet/__init__.py
nvmetcli

index 9a0b51d81a0c1e78ad3d3c6bfedeb98b9393a921..6542d8781cefc2e62d7606da8cc8cadf38cd1f8f 100644 (file)
@@ -1 +1 @@
-from .nvme import Root, Subsystem, Namespace, Port, Host
+from .nvme import Root, Subsystem, Namespace, Port, Host, Referral
index 8140fc6b29dff3aef87e2d09600337cf703b3f6c..9f7eacf214b750084fa373428fbab4247d364bf9 100755 (executable)
--- a/nvmetcli
+++ b/nvmetcli
@@ -460,7 +460,7 @@ class UIReferralNode(UINode):
         'traddr': ('string', 'Transport Address (e.g. IP Address)'),
         'trsvcid': ('string', 'Transport Service ID (e.g. IP Port)'),
         'trtype': ('string', 'Transport Type (e.g. rdma or loop)'),
-        'portid': ('int', 'Port identifier'),
+        'portid': ('number', 'Port identifier'),
     }
 
     def __init__(self, parent, cfnode):