Run of fresh-releases for python-rtslib-fb

Try this locally (using silver-platter):

debian-svp new-upstream python-rtslib-fb 

Merge these changes:

Summary

Merged new upstream version: 2.1.72 (was: 2.1.71).

Diff

diff --git a/debian/changelog b/debian/changelog
index a0da9ef..590da9b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-rtslib-fb (2.1.72-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 22 Apr 2020 14:48:50 +0000
+
 python-rtslib-fb (2.1.71-1) experimental; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/fix-path-of-etc-saveconfig.json.patch b/debian/patches/fix-path-of-etc-saveconfig.json.patch
index 0ad3b8a..947f7e7 100644
--- a/debian/patches/fix-path-of-etc-saveconfig.json.patch
+++ b/debian/patches/fix-path-of-etc-saveconfig.json.patch
@@ -40,7 +40,7 @@ Index: python-rtslib-fb/rtslib/root.py
  
      def __init__(self):
          '''
-@@ -441,7 +441,7 @@ class RTSRoot(CFSNode):
+@@ -449,7 +449,7 @@ class RTSRoot(CFSNode):
      def save_to_file(self, save_file=None, so_path=None):
          '''
          Write the configuration in json format to a file.
@@ -49,7 +49,7 @@ Index: python-rtslib-fb/rtslib/root.py
          '''
          if not save_file:
              save_file = default_save_file
-@@ -469,7 +469,7 @@ class RTSRoot(CFSNode):
+@@ -477,7 +477,7 @@ class RTSRoot(CFSNode):
                            abort_on_error=False):
          '''
          Restore the configuration from a file in json format.
diff --git a/rtslib/__init__.py b/rtslib/__init__.py
index 80ebac9..c47dc44 100644
--- a/rtslib/__init__.py
+++ b/rtslib/__init__.py
@@ -36,7 +36,7 @@ from .tcm import StorageObjectFactory
 
 from .alua import ALUATargetPortGroup
 
-__version__ = '2.1.71'
+__version__ = '2.1.72'
 __author__ = "Jerome Martin <jxm@risingtidesystems.com>"
 __url__ = 'http://github.com/open-iscsi/rtslib-fb'
 __description__ = 'API for Linux kernel SCSI target (aka LIO)'
diff --git a/rtslib/fabric.py b/rtslib/fabric.py
index b529f14..02e156c 100644
--- a/rtslib/fabric.py
+++ b/rtslib/fabric.py
@@ -486,3 +486,7 @@ class FabricModule(object):
     def all(cls):
         for mod in six.itervalues(fabric_modules):
             yield mod()
+
+    @classmethod
+    def list_registered_drivers(cls):
+        return os.listdir('/sys/module/target_core_mod/holders')
diff --git a/rtslib/root.py b/rtslib/root.py
index b83d7ee..15d8cc5 100644
--- a/rtslib/root.py
+++ b/rtslib/root.py
@@ -85,7 +85,7 @@ class RTSRoot(CFSNode):
             modprobe('target_core_mod')
             self._create_in_cfs_ine('any')
 
-        self._set_dbroot_if_needed()
+        self._set_dbroot()
 
     def _list_targets(self):
         self._check_self()
@@ -160,13 +160,21 @@ class RTSRoot(CFSNode):
     def __str__(self):
         return "rtslib"
 
-    def _set_dbroot_if_needed(self):
+    def _set_dbroot(self):
         dbroot_path = self.path + "/dbroot"
         if not os.path.exists(dbroot_path):
             self._dbroot = self._default_dbroot
             return
         self._dbroot = fread(dbroot_path)
         if self._dbroot != self._preferred_dbroot:
+            if len(FabricModule.list_registered_drivers()) is not 0:
+                # Writing to dbroot_path after drivers have been registered will make the kernel emit this error:
+                # db_root: cannot be changed: target drivers registered
+                from warnings import warn
+                warn("Cannot set dbroot to {}. Target drivers have already been registered."
+                     .format(self._preferred_dbroot))
+                return
+
             try:
                 fwrite(dbroot_path, self._preferred_dbroot+"\n")
             except:

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.72.egg-info/PKG-INFO
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.72.egg-info/dependency_links.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.72.egg-info/requires.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.72.egg-info/top_level.txt

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.71.egg-info/PKG-INFO
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.71.egg-info/dependency_links.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.71.egg-info/requires.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/rtslib_fb-2.1.71.egg-info/top_level.txt

No differences were encountered in the control files

Full worker log Full build log