Blob Blame History Raw
From 627e236a6e6554c2c4f95ae2c257a278fbf7c143 Mon Sep 17 00:00:00 2001
From: Brent Baude <bbaude@redhat.com>
Date: Mon, 19 Jun 2017 14:23:07 -0500
Subject: [PATCH] Atomic/systemcontainers.py: Set prefix to "/" if None

In the case of installing a systemcontainer, if using python3 and the
prefix ends up being None, it throws a traceback as reported in
bz #1461994.  Using prefix or "/" fixes this issue.
---
 Atomic/syscontainers.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Atomic/syscontainers.py b/Atomic/syscontainers.py
index b3906d51..f0773f50 100644
--- a/Atomic/syscontainers.py
+++ b/Atomic/syscontainers.py
@@ -814,10 +814,10 @@ def _do_checkout(self, repo, name, img, upgrade, deployment, values, destination
 
         if has_container_service:
             util.write_template(unitfile, systemd_template, values, unitfileout)
-            shutil.copyfile(unitfileout, os.path.join(prefix, destination, "%s.service" % name))
+            shutil.copyfile(unitfileout, os.path.join(prefix or "/", destination, "%s.service" % name))
         if (tmpfiles_template):
             util.write_template(unitfile, tmpfiles_template, values, tmpfilesout)
-            shutil.copyfile(tmpfilesout, os.path.join(prefix, destination, "tmpfiles-%s.conf" % name))
+            shutil.copyfile(tmpfilesout, os.path.join(prefix or "/", destination, "tmpfiles-%s.conf" % name))
 
         if not prefix:
             sym = "%s/%s" % (self._get_system_checkout_path(), name)