File nvmetcli-make-dict-access-python-version-independant.patch of Package nvmetcli.10838

From: Lee Duncan <lduncan@suse.com>
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:
openSUSE Build Service is sponsored by