Blame SOURCES/rtslib-fix-setup.patch

6b4347
diff --git a/rtslib/root.py b/rtslib/root.py
6b4347
index 246c285..d558445 100644
6b4347
--- a/rtslib/root.py
6b4347
+++ b/rtslib/root.py
6b4347
@@ -70,6 +70,7 @@ class RTSRoot(CFSNode):
6b4347
         base kernel modules (tcm)
6b4347
         '''
6b4347
         super(RTSRoot, self).__init__()
6b4347
+        modprobe('configfs')
6b4347
         mount_configfs()
6b4347
         modprobe('target_core_mod')
6b4347
         self._create_in_cfs_ine('any')
6b4347
@@ -247,7 +248,7 @@ class RTSRoot(CFSNode):
6b4347
         if not restore_file:
6b4347
             restore_file = default_save_file
6b4347
 
6b4347
-        with open(from_file, "r") as f:
6b4347
+        with open(restore_file, "r") as f:
6b4347
             config = json.loads(f.read())
6b4347
             return self.restore(config, clear_existing=True,
6b4347
                                 abort_on_error=abort_on_error)
6b4347
diff --git a/scripts/targetctl b/scripts/targetctl
6b4347
index db8e0d2..bdf59f4 100755
6b4347
--- a/scripts/targetctl
6b4347
+++ b/scripts/targetctl
6b4347
@@ -42,8 +42,7 @@ def save(to_file):
6b4347
     RTSRoot().save_to_file(save_file=to_file)
6b4347
 
6b4347
 def restore(from_file):
6b4347
-        errors = RTSRoot().restore_from_file(restore_file=from_file,
6b4347
-                                             clear_existing=True)
6b4347
+        errors = RTSRoot().restore_from_file(restore_file=from_file)
6b4347
 
6b4347
         if errors:
6b4347
             print("Restore failed, %d errors:" % len(errors), file=err)
6b4347
diff --git a/setup.py b/setup.py
6b4347
index 7f41d52..5886fbc 100755
6b4347
--- a/setup.py
6b4347
+++ b/setup.py
6b4347
@@ -27,5 +27,6 @@ setup (
6b4347
     maintainer_email = 'agrover@redhat.com',
6b4347
     url = 'http://github.com/agrover/rtslib-fb',
6b4347
     packages = ['rtslib'],
6b4347
+    scripts = ['scripts/targetctl'],
6b4347
     use_2to3 = True,
6b4347
     )