Hello community, here is the log from the commit of package nvmetcli for openSUSE:Factory checked in at 2018-04-19 15:32:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nvmetcli (Old) and /work/SRC/openSUSE:Factory/.nvmetcli.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nvmetcli" Thu Apr 19 15:32:44 2018 rev:9 rq:598058 version:0.6 Changes: -------- --- /work/SRC/openSUSE:Factory/nvmetcli/nvmetcli.changes 2018-04-11 14:00:37.893752294 +0200 +++ /work/SRC/openSUSE:Factory/.nvmetcli.new/nvmetcli.changes 2018-04-19 15:32:46.574952117 +0200 @@ -1,0 +2,18 @@ +Mon Apr 16 19:08:25 UTC 2018 - [email protected] + +- Stop using singlespec, since we only need a + python3 version of this package, and we do not + want it named "python3-nvmetcli" (bsc#1082208). + Also, use the "python-six" module to make + dictionary iteration work for Python 2 and 3, + adding patch: + * nvmetcli-make-dict-access-python-version-independant.patch + +------------------------------------------------------------------- +Fri Apr 13 17:47:21 UTC 2018 - [email protected] + +- Support python3 by using the python-six module, + and convert dictionary access to use 'six' routines, + so we can work on python 2 or python 3 (bsc#1082208) + +------------------------------------------------------------------- New: ---- nvmetcli-make-dict-access-python-version-independant.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nvmetcli.spec ++++++ --- /var/tmp/diff_new_pack.yrsjOy/_old 2018-04-19 15:32:47.242924590 +0200 +++ /var/tmp/diff_new_pack.yrsjOy/_new 2018-04-19 15:32:47.246924426 +0200 @@ -16,10 +16,6 @@ # -# python2 version of this no longer needed -%define skip_python2 1 - -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: nvmetcli Version: 0.6 Release: 1%{?dist} @@ -29,19 +25,17 @@ Url: http://git.infradead.org/users/hch/nvmetcli.git Source: nvmetcli-v%{version}.tar.gz Patch1: %{name}-update-python-to-python3.patch -BuildRequires: %{python_module devel} -BuildRequires: %{python_module setuptools} -BuildRequires: python-rpm-macros -Requires: python-configshell-fb -Requires: python-kmod +Patch2: %{name}-make-dict-access-python-version-independant.patch +BuildRequires: python3-devel +BuildRequires: python3-setuptools +Requires: python3-configshell-fb +Requires: python3-kmod Requires(post): systemd Requires(postun): systemd Requires(preun): systemd BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch -%python_subpackages - %description This package contains the command line interface to the NVMe over Fabrics target in the Linux kernel. It allows configuring the NVMe @@ -51,12 +45,13 @@ %prep %setup -q -n nvmetcli-v%{version} %patch1 -p1 +%patch2 -p1 %build -%python_build +python3 setup.py build %install -%python_install +python3 setup.py install --skip-build --root=%{buildroot} --prefix=usr mkdir -p %{buildroot}%{_sysconfdir}/nvmet mkdir -p %{buildroot}%{_prefix}/sbin install -m 755 nvmetcli %{buildroot}%{_sbindir}/nvmetcli @@ -79,7 +74,7 @@ %files %defattr(-,root,root,-) -%{python_sitelib} +%{python3_sitelib} %dir %{_sysconfdir}/nvmet %{_sbindir}/nvmetcli /usr/sbin/rcnvmet ++++++ nvmetcli-make-dict-access-python-version-independant.patch ++++++ From: Lee Duncan <[email protected]> Date: Sun Apr 8 13:35:35 PDT 2018 Subject: [PATCH] support Python3 dictionary access Patch-mainline: submitted to linux-nvme 4/13/2018 As part of supporting python3, use the 'python-six' package to support iterating on items in a python dictionary. --- diff -aurp nvmetcli-v0.6.orig/nvmet/nvme.py nvmetcli-v0.6/nvmet/nvme.py --- nvmetcli-v0.6.orig/nvmet/nvme.py 2018-01-22 10:45:05.000000000 -0800 +++ nvmetcli-v0.6/nvmet/nvme.py 2018-04-13 10:23:14.390667798 -0700 @@ -23,6 +23,7 @@ import stat import uuid import json from glob import iglob as glob +from six import iteritems DEFAULT_SAVE_FILE = '/etc/nvmet/config.json' @@ -219,7 +220,7 @@ class CFSNode(object): def _setup_attrs(self, attr_dict, err_func): for group in self.attr_groups: - for name, value in attr_dict.get(group, {}).iteritems(): + for name, value in iteritems(attr_dict.get(group, {})): try: self.set_attr(group, name, value) except CFSError as e:
