Fixes delorean repo update on undercloud 09/55109/1
authorTim Rozet <trozet@redhat.com>
Fri, 6 Apr 2018 18:55:00 +0000 (14:55 -0400)
committerTim Rozet <trozet@redhat.com>
Fri, 6 Apr 2018 21:52:14 +0000 (21:52 +0000)
Previous fix to update delorean repo on undercloud was always failing
because the operations passed to virt-customize were not in a list type.

JIRA: APEX-565

Change-Id: Ic883309ac1c3aa6027dc252635e404e5355c269d
Signed-off-by: Tim Rozet <trozet@redhat.com>
(cherry picked from commit 3812d0987d078a8a0ad93724e8188994b7579e50)

apex/tests/test_apex_undercloud.py
apex/undercloud/undercloud.py

index 9e2752a..fce7a55 100644 (file)
@@ -225,5 +225,5 @@ class TestUndercloud(unittest.TestCase):
             "https://trunk.rdoproject.org/centos7-{}"
             "/current-tripleo/delorean.repo".format(
                 constants.DEFAULT_OS_VERSION))
             "https://trunk.rdoproject.org/centos7-{}"
             "/current-tripleo/delorean.repo".format(
                 constants.DEFAULT_OS_VERSION))
-        test_ops = {'--run-command': download_cmd}
+        test_ops = [{'--run-command': download_cmd}]
         mock_vutils.virt_customize.assert_called_with(test_ops, uc.volume)
         mock_vutils.virt_customize.assert_called_with(test_ops, uc.volume)
index 2972351..d76174b 100644 (file)
@@ -276,7 +276,7 @@ class Undercloud:
             cmd = ("curl -L -f -o "
                    "/etc/yum.repos.d/deloran.repo {}".format(delorean_repo))
             try:
             cmd = ("curl -L -f -o "
                    "/etc/yum.repos.d/deloran.repo {}".format(delorean_repo))
             try:
-                virt_utils.virt_customize({constants.VIRT_RUN_CMD: cmd},
+                virt_utils.virt_customize([{constants.VIRT_RUN_CMD: cmd}],
                                           self.volume)
             except Exception:
                 logging.warning("Failed to download and update delorean repo "
                                           self.volume)
             except Exception:
                 logging.warning("Failed to download and update delorean repo "