diff options
author | Andrew Butcher <abutcher@afrolegs.com> | 2017-01-10 16:10:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 16:10:58 -0500 |
commit | 706c582b2482d5cc3a4fb28b348ce5b856fc9c26 (patch) | |
tree | 8cde7a18c67cfe804ec139f1a8c4113bfe5704c3 | |
parent | 15054dfdbe77dddbca393c3559c4858d9a2c5087 (diff) | |
parent | cd933dd5488640ac1c05657e3fe6fe978377734c (diff) | |
download | openshift-706c582b2482d5cc3a4fb28b348ce5b856fc9c26.tar.gz openshift-706c582b2482d5cc3a4fb28b348ce5b856fc9c26.tar.bz2 openshift-706c582b2482d5cc3a4fb28b348ce5b856fc9c26.tar.xz openshift-706c582b2482d5cc3a4fb28b348ce5b856fc9c26.zip |
Merge pull request #3065 from ashcrow/rpmrebuilddb
Workaround for dnf+docker version race condition
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index d7e3596fd..0222b664b 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1256,6 +1256,13 @@ def is_service_running(service): return service_running +def rpm_rebuilddb(): + """ + Runs rpm --rebuilddb to ensure the db is in good shape. + """ + module.run_command(['/usr/bin/rpm', '--rebuilddb']) # noqa: F405 + + def get_version_output(binary, version_cmd): """ runs and returns the version output for a command """ cmd = [] @@ -1966,6 +1973,11 @@ class OpenShiftFacts(object): if 'docker' in roles: docker = dict(disable_push_dockerhub=False, options='--log-driver=json-file --log-opt max-size=50m') + # NOTE: This is a workaround for a dnf output racecondition that can occur in + # some situations. See https://bugzilla.redhat.com/show_bug.cgi?id=918184 + if self.system_facts['ansible_pkg_mgr'] == 'dnf': + rpm_rebuilddb() + version_info = get_docker_version_info() if version_info is not None: docker['api_version'] = version_info['api_version'] |