]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
install/rpm: fix use the 'zypper addrepo' command 1348/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 11 Nov 2019 15:12:18 +0000 (16:12 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 11 Nov 2019 15:12:18 +0000 (16:12 +0100)
The 74034fe0348b94aedb247910f0d1c88842f4c3ac instroduced a failure:

  Warning: No repositories defined.
  Use the 'zypper addrepo' command to add one or more repositories.

The wipe command returns exit code 6 if there is no repos in the system.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/task/install/rpm.py

index 437941339a6a55b6e859ee80e30afe0e1c8ed2fd..fc579a61099c2c17e5444ace7a3fc757ca6d2f7f 100644 (file)
@@ -104,7 +104,9 @@ def _zypper_wipe_all_repos(remote):
     :return:
     """
     log.info("Wiping zypper repos (if any)")
-    remote.sh('sudo zypper repos -upEP && sudo rm -f /etc/zypp/repos.d/*')
+    remote.sh('sudo zypper repos -upEP && '
+              'sudo rm -f /etc/zypp/repos.d/* || '
+              'true')
 
 def _downgrade_packages(ctx, remote, pkgs, pkg_version, config):
     """