All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell
@ 2017-03-27 17:46 Mauro S. M. Rodrigues
  2017-03-27 17:46 ` [PATCH 2/3] nvmetcli: Fix Referral operation " Mauro S. M. Rodrigues
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Mauro S. M. Rodrigues @ 2017-03-27 17:46 UTC (permalink / raw)


Operations against Port and Host entities are broken. When performing
operations like the follow:

/ports> create 1
/hosts> create 1

nvmetcli fails, saying the object doesn't have the attribute we're
trying to access, for instance:
'module' object has no attribute 'Port'

This patch fixes this issue by importing the classes Port and Host in
nvmet/__init__.py which was forgotten during the follow change:

a21ebd54f0 ("nvmetcli: Fix nvmet import").

Tested-by: Guilherme G. Piccoli <gpiccoli at linux.vnet.ibm.com>
Signed-off-by: Mauro S. M. Rodrigues <maurosr at linux.vnet.ibm.com>
---
 nvmet/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvmet/__init__.py b/nvmet/__init__.py
index a084151..9a0b51d 100644
--- a/nvmet/__init__.py
+++ b/nvmet/__init__.py
@@ -1 +1 @@
-from .nvme import Root, Subsystem, Namespace
+from .nvme import Root, Subsystem, Namespace, Port, Host
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] nvmetcli: Fix Referral operation in shell
  2017-03-27 17:46 [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Mauro S. M. Rodrigues
@ 2017-03-27 17:46 ` Mauro S. M. Rodrigues
  2017-03-28 10:41   ` Sagi Grimberg
  2017-03-30  8:27   ` Christoph Hellwig
  2017-03-27 17:46 ` [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH Mauro S. M. Rodrigues
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Mauro S. M. Rodrigues @ 2017-03-27 17:46 UTC (permalink / raw)


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 at linux.vnet.ibm.com>
Signed-off-by: Mauro S. M. Rodrigues <maurosr at linux.vnet.ibm.com>
---
 nvmet/__init__.py | 2 +-
 nvmetcli          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/nvmet/__init__.py b/nvmet/__init__.py
index 9a0b51d..6542d87 100644
--- a/nvmet/__init__.py
+++ b/nvmet/__init__.py
@@ -1 +1 @@
-from .nvme import Root, Subsystem, Namespace, Port, Host
+from .nvme import Root, Subsystem, Namespace, Port, Host, Referral
diff --git a/nvmetcli b/nvmetcli
index 8140fc6..9f7eacf 100755
--- 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):
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH
  2017-03-27 17:46 [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Mauro S. M. Rodrigues
  2017-03-27 17:46 ` [PATCH 2/3] nvmetcli: Fix Referral operation " Mauro S. M. Rodrigues
@ 2017-03-27 17:46 ` Mauro S. M. Rodrigues
  2017-03-28 10:41   ` Sagi Grimberg
  2017-03-30  8:28   ` Christoph Hellwig
  2017-03-28 10:40 ` [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Sagi Grimberg
  2017-03-30  8:27 ` Christoph Hellwig
  3 siblings, 2 replies; 11+ messages in thread
From: Mauro S. M. Rodrigues @ 2017-03-27 17:46 UTC (permalink / raw)


According to the README, one can install nvmetcli through setup.py.
When we try this, though, the nvmetcli wasn't configured in system's
$PATH.
Adding it to script list in setup.py solved the issue.

Tested-by: Guilherme G. Piccoli <gpiccoli at linux.vnet.ibm.com>
Signed-off-by: Mauro S. M. Rodrigues <maurosr at linux.vnet.ibm.com>
---
 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index fdd6cea..4bd2ac2 100755
--- a/setup.py
+++ b/setup.py
@@ -27,4 +27,5 @@ setup(
     maintainer_email = 'hch at lst.de',
     test_suite='nose2.collector.collector',
     packages = ['nvmet'],
+    scripts=['./nvmetcli'],
     )
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell
  2017-03-27 17:46 [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Mauro S. M. Rodrigues
  2017-03-27 17:46 ` [PATCH 2/3] nvmetcli: Fix Referral operation " Mauro S. M. Rodrigues
  2017-03-27 17:46 ` [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH Mauro S. M. Rodrigues
@ 2017-03-28 10:40 ` Sagi Grimberg
  2017-03-30  8:27 ` Christoph Hellwig
  3 siblings, 0 replies; 11+ messages in thread
From: Sagi Grimberg @ 2017-03-28 10:40 UTC (permalink / raw)



> Operations against Port and Host entities are broken. When performing
> operations like the follow:

Tested-by: Sagi Grimberg <sagi at grimberg.m>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/3] nvmetcli: Fix Referral operation in shell
  2017-03-27 17:46 ` [PATCH 2/3] nvmetcli: Fix Referral operation " Mauro S. M. Rodrigues
@ 2017-03-28 10:41   ` Sagi Grimberg
  2017-03-30  8:27   ` Christoph Hellwig
  1 sibling, 0 replies; 11+ messages in thread
From: Sagi Grimberg @ 2017-03-28 10:41 UTC (permalink / raw)


Looks good,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH
  2017-03-27 17:46 ` [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH Mauro S. M. Rodrigues
@ 2017-03-28 10:41   ` Sagi Grimberg
  2017-03-30  8:28   ` Christoph Hellwig
  1 sibling, 0 replies; 11+ messages in thread
From: Sagi Grimberg @ 2017-03-28 10:41 UTC (permalink / raw)


Looks good,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell
  2017-03-27 17:46 [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Mauro S. M. Rodrigues
                   ` (2 preceding siblings ...)
  2017-03-28 10:40 ` [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Sagi Grimberg
@ 2017-03-30  8:27 ` Christoph Hellwig
  3 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2017-03-30  8:27 UTC (permalink / raw)


Thanks Mauro,

applied.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/3] nvmetcli: Fix Referral operation in shell
  2017-03-27 17:46 ` [PATCH 2/3] nvmetcli: Fix Referral operation " Mauro S. M. Rodrigues
  2017-03-28 10:41   ` Sagi Grimberg
@ 2017-03-30  8:27   ` Christoph Hellwig
  1 sibling, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2017-03-30  8:27 UTC (permalink / raw)


Thanks, applied.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH
  2017-03-27 17:46 ` [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH Mauro S. M. Rodrigues
  2017-03-28 10:41   ` Sagi Grimberg
@ 2017-03-30  8:28   ` Christoph Hellwig
  2017-04-05 23:56     ` Mauro Rodrigues
  1 sibling, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2017-03-30  8:28 UTC (permalink / raw)


On Mon, Mar 27, 2017@02:46:45PM -0300, Mauro S. M. Rodrigues wrote:
> According to the README, one can install nvmetcli through setup.py.
> When we try this, though, the nvmetcli wasn't configured in system's
> $PATH.
> Adding it to script list in setup.py solved the issue.

Andy sent the same patch a while ago, but it needs a fixup to

 a) install into /usr/sbin
 b) fixups to the deb and rpm packaging to take this into account

Do you want to fix this up?  Otherwise I'll try to get to it myself,
I should be able to access a Fedora test box again now.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH
  2017-03-30  8:28   ` Christoph Hellwig
@ 2017-04-05 23:56     ` Mauro Rodrigues
  2017-04-06  7:20       ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Mauro Rodrigues @ 2017-04-05 23:56 UTC (permalink / raw)


On Thu, Mar 30, 2017@10:28:55AM +0200, Christoph Hellwig wrote:
> On Mon, Mar 27, 2017@02:46:45PM -0300, Mauro S. M. Rodrigues wrote:
> > According to the README, one can install nvmetcli through setup.py.
> > When we try this, though, the nvmetcli wasn't configured in system's
> > $PATH.
> > Adding it to script list in setup.py solved the issue.
> 
> Andy sent the same patch a while ago, but it needs a fixup to
> 
>  a) install into /usr/sbin
>  b) fixups to the deb and rpm packaging to take this into account
> 
> Do you want to fix this up?  Otherwise I'll try to get to it myself,
> I should be able to access a Fedora test box again now.
>
Hi Cristoph!

I just sent a new version of the patch. I've also checked the contents
of both rpm and deb packages and everything looks correct:

~/dev/nvmetcli$ dpkg -c dist/nvmetcli_0.3.3.g08963d2_all.deb  |grep /usr/sbin/nvmetcli
-rwxr-xr-x root/root     17050 2017-04-05 15:47 ./usr/sbin/nvmetcli

and for the rpm:

# rpm -ql nvmetcli |grep /usr/sbin/nvmetcli
/usr/sbin/nvmetcli

Please let me know if I missed anything here.

Thanks in advanced!

--
Mauro Rodrigues

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH
  2017-04-05 23:56     ` Mauro Rodrigues
@ 2017-04-06  7:20       ` Christoph Hellwig
  0 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2017-04-06  7:20 UTC (permalink / raw)


Thanks a lot Mauro!

I've applied your new version of the patch.  I'll also plan to cut a new
release in the next days with the various small fixes we had.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-04-06  7:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 17:46 [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Mauro S. M. Rodrigues
2017-03-27 17:46 ` [PATCH 2/3] nvmetcli: Fix Referral operation " Mauro S. M. Rodrigues
2017-03-28 10:41   ` Sagi Grimberg
2017-03-30  8:27   ` Christoph Hellwig
2017-03-27 17:46 ` [PATCH 3/3] nvmetcli: Install nvmetcli executable in $PATH Mauro S. M. Rodrigues
2017-03-28 10:41   ` Sagi Grimberg
2017-03-30  8:28   ` Christoph Hellwig
2017-04-05 23:56     ` Mauro Rodrigues
2017-04-06  7:20       ` Christoph Hellwig
2017-03-28 10:40 ` [PATCH 1/3] nvmetcli: Fix Port and Host operations in shell Sagi Grimberg
2017-03-30  8:27 ` 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.