diff --git a/core/update_obs_repos.py b/core/update_obs_repos.py index 55257cbbe5f1bfcf9e3a0e5bcc7377674fe211f4..9bce03adcfb80ef6f28e46b5c81bcaab50ad0ace 100755 --- a/core/update_obs_repos.py +++ b/core/update_obs_repos.py @@ -209,9 +209,11 @@ class RPMManager(object): """ with open(self.obs_pkg_rpms_file, "w", encoding="utf-8") as f: yaml.dump(self.old_pkg_rpms, f) - cmd = "cd %s && git pull && git add %s && git commit -m 'update rpms' && git push && cd - && rm -rf %s" \ - % (self.obs_pkg_rpms_files_dir, self.obs_pkg_rpms_file, self.obs_pkg_rpms_files_dir) - os.system(cmd) + for i in range(5): + cmd = "cd %s && git pull && git add %s && git commit -m 'update rpms' && git push && cd - && rm -rf %s" \ + % (self.obs_pkg_rpms_files_dir, self.obs_pkg_rpms_file, self.obs_pkg_rpms_files_dir) + if os.system(cmd) == 0: + break def update_repos_db(self): """