[sandbox PATCH 2/2] Unit files only exist in Systemd Containers.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not attempt to fix the unit file of Generic Containers.
---
 bin/virt-sandbox-service | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
index 03873c9..3e83c94 100755
--- a/bin/virt-sandbox-service
+++ b/bin/virt-sandbox-service
@@ -928,28 +928,28 @@ def upgrade_config_legacy(path):
     else:
         container = SystemdContainer(uri=args.uri, config=config)
 
-    fd = open(container.get_unit_path())
-    unitfile = fd.read()
-    fd.close()
+        fd = open(container.get_unit_path())
+        unitfile = fd.read()
+        fd.close()
 
-    unitfile = unitfile.replace("/usr/bin/virt-sandbox-service start",
-                                "/usr/libexec/virt-sandbox-service-util -c lxc:/// -s")
-    unitfile = unitfile.replace("/usr/bin/virt-sandbox-service reload",
-                                "/usr/bin/virt-sandbox-service -c lxc:/// reload")
-    unitfile = unitfile.replace("/usr/bin/virt-sandbox-service stop",
-                                "/usr/bin/virsh -c lxc:/// destroy")
+        unitfile = unitfile.replace("/usr/bin/virt-sandbox-service start",
+                                    "/usr/libexec/virt-sandbox-service-util -c lxc:/// -s")
+        unitfile = unitfile.replace("/usr/bin/virt-sandbox-service reload",
+                                    "/usr/bin/virt-sandbox-service -c lxc:/// reload")
+        unitfile = unitfile.replace("/usr/bin/virt-sandbox-service stop",
+                                    "/usr/bin/virsh -c lxc:/// destroy")
 
-    unitfile = re.sub("WantedBy=.*\.target",
-                      "WantedBy=multi-user.target",
-                      unitfile)
+        unitfile = re.sub("WantedBy=.*\.target",
+                          "WantedBy=multi-user.target",
+                          unitfile)
 
-    os.remove(container.get_unit_path())
-    fd = open(container.get_unit_path(), "wx")
-    fd.write(unitfile)
-    fd.close()
+        os.remove(container.get_unit_path())
+        fd = open(container.get_unit_path(), "wx")
+        fd.write(unitfile)
+        fd.close()
 
-    sys.stdout.write(_("Created unit file %s\n") %
-                     container.get_unit_path())
+        sys.stdout.write(_("Created unit file %s\n") %
+                         container.get_unit_path())
 
     # Create new config file + libvirt persistent XML config
     container.save_config()
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]