diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-05-23 12:59:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 12:59:18 -0500 |
commit | 0be5c329c0e6439752ebb9afb1422daf15fd79de (patch) | |
tree | b78d016f589a5e097c48bd5605a575e2ec720b42 /openshift-ansible.spec | |
parent | 387b5d3f2eee89d1b7e87844e2912b66c380b413 (diff) | |
parent | 946e84af0497f5b7aade361b95f7c1bff9ab45fd (diff) | |
download | openshift-0be5c329c0e6439752ebb9afb1422daf15fd79de.tar.gz openshift-0be5c329c0e6439752ebb9afb1422daf15fd79de.tar.bz2 openshift-0be5c329c0e6439752ebb9afb1422daf15fd79de.tar.xz openshift-0be5c329c0e6439752ebb9afb1422daf15fd79de.zip |
Merge pull request #4079 from sosiouxme/20170503-move-check-playbook
Merged by openshift-bot
Diffstat (limited to 'openshift-ansible.spec')
-rw-r--r-- | openshift-ansible.spec | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 55bd523c3..98faf94c4 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -161,23 +161,29 @@ BuildArch: noarch %files playbooks %{_datadir}/ansible/%{name}/playbooks -# We moved playbooks/common/openshift-master/library up to the top and replaced -# it with a symlink. RPM doesn't handle this so we have to do some pre-transaction -# magic. See https://fedoraproject.org/wiki/Packaging:Directory_Replacement +# Along the history of openshift-ansible, some playbook directories had to be +# moved and were replaced with symlinks for backwards compatibility. +# RPM doesn't handle this so we have to do some pre-transaction magic. +# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement %pretrans playbooks -p <lua> --- Define the path to directory being replaced below. +-- Define the paths to directories being replaced below. -- DO NOT add a trailing slash at the end. -path = "/usr/share/ansible/openshift-ansible/playbooks/common/openshift-master/library" -st = posix.stat(path) -if st and st.type == "directory" then - status = os.rename(path, path .. ".rpmmoved") - if not status then - suffix = 0 - while not status do - suffix = suffix + 1 - status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) +dirs_to_sym = { + "/usr/share/ansible/openshift-ansible/playbooks/common/openshift-master/library", + "/usr/share/ansible/openshift-ansible/playbooks/certificate_expiry" +} +for i,path in ipairs(dirs_to_sym) do + st = posix.stat(path) + if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") end - os.rename(path, path .. ".rpmmoved") end end |