nvmetcli fixes
cover nvmetcli fixes
Here are some small fixes that help packaging nvmetcli, and help it minimally work with Python 3 -- there are likely more Py2/3 issues that will come out in testing but this gets us past initial import errors.
Thanks -- Andy
Andy Grover (3):
Add nvmetcli to setup.py scripts
Use relative import in nvmet/__init__.py
nvmetcli: Fix nvmet import
nvmet/__init__.py | 2 +- nvmetcli | 2 +- setup.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 Add nvmetcli to setup.py scripts
This results in nvmetcli being placed in the right place on install, and the interpreter name will be changed to the current interpreter name, which may be different, e.g. /usr/bin/python3.
--- setup.py | 1 + 1 file changed, 1 insertion(+)
setup.py +1 -0
@@ -27,4 +27,5 @@ setup( maintainer_email = 'hch at lst.de', test_suite='nose2.collector.collector', packages = ['nvmet'], + scripts = ['nvmetcli'], )
Signature · 1 line
2.7.4
PATCH 1/3 Add nvmetcli to setup.py scripts
Quoted 5 lines · Andy Grover
This results in nvmetcli being placed in the right place on install, and the interpreter name will be changed to the current interpreter name, which may be different, e.g.
/usr/bin/python3.Signed-off-by Andy Grover <agrover at redhat.com>
It installs it into the wrong place unfortunately, /usr/bin instead of /usr/sbin.
PATCH 1/3 Add nvmetcli to setup.py scripts
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Andy Grover
This results in nvmetcli being placed in the right place on install, and the interpreter name will be changed to the current interpreter name, which may be different, e.g.
/usr/bin/python3.Signed-off-by Andy Grover <agrover at redhat.com>It installs it into the wrong place unfortunately,
/usr/bininstead of/usr/sbin.
There's a command-line argument to 'python setup.py install', --install-scripts, that can be used to put it in /usr/sbin if you want...
-- Andy
PATCH 1/3 Add nvmetcli to setup.py scripts
Quoted 6 lines · Andy Grover
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · Andy Grover
This results in nvmetcli being placed in the right place on install, and the interpreter name will be changed to the current interpreter name, which may be different, e.g.
/usr/bin/python3.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Andy Grover <agrover at redhat.com>It installs it into the wrong place unfortunately,
/usr/bininstead of/usr/sbin.There's a command-line argument to 'python
setup.pyinstall', --install-scripts, that can be used to put it in/usr/sbinif you want...
Can you fix up the specfile to use it? I'll take care of the Debian packaging then.
PATCH 2/3 Use relative import in nvmet/__init__.py
In reply to Andy GroverThis is supported by Python 2.7 and later.
--- nvmet/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
nvmet/__init__.py +1 -1
@@ -1 +1 @@ -from nvme import Root, Subsystem, Namespace +from .nvme import Root, Subsystem, Namespace
Signature · 1 line
2.7.4
PATCH 3/3 nvmetcli: Fix nvmet import
In reply to Andy GroverWe should just need to import nvmet, which will run __init__.py and import just the public things from nvmet/nvme.py.
--- nvmetcli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
nvmetcli +1 -1
@@ -23,7 +23,7 @@ from __future__ import print_function import os import sys import configshell_fb as configshell -import nvmet.nvme as nvme +import nvmet as nvme class UINode(configshell.node.ConfigNode):
Signature · 1 line
2.7.4
cover nvmetcli fixes
In reply to Andy GroverQuoted 4 lines · Andy Grover
Here are some small fixes that help packaging nvmetcli, and help it minimally work with Python 3 -- there are likely more Py2/3 issues that will come out in testing but this gets us past initial import errors.
Thanks Andy, I've applied patches 2 and 3. Any idea how to get nvmetcli installed to /usr/sbin using setuptools?