[cfg01] reclass: Apply broken default patch first 73/65673/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sat, 8 Dec 2018 16:02:37 +0000 (17:02 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sat, 8 Dec 2018 16:06:32 +0000 (17:06 +0100)
reclass settings.py should be patched before the salt-master service
is started (since we can't restart it inside the container without
killing the tini init).

Fixes: 2de5348a

Change-Id: Id62d8f9f12fd72ef60322dd9907f26907231c4a7
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/config/states/virtual_init
mcp/scripts/docker-compose/files/entrypoint.sh

index e234b72..46d8804 100755 (executable)
@@ -22,9 +22,6 @@ NODE_MASK="${LOCAL_VIRT_NODES// /|}"
 
 wait_for 5.0 "salt-call state.sls reclass,linux.network,salt.minion \
               exclude='[{id: reclass_packages}, {id: /etc/reclass/reclass-config.yml}]'"
-# Workaround for: https://github.com/salt-formulas/reclass/issues/77
-salt-call file.replace '/usr/local/lib/python2.7/dist-packages/reclass/settings.py' \
-  pattern='(ignore_overwritten_missing_references)defaults.' repl='\1'
 wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.refresh_pillar"
 
 # NOTE: domain name changes are not yet supported without a clean redeploy
index 9bf3cfc..0199c39 100755 (executable)
@@ -74,6 +74,10 @@ sed -i -e "s|return 'start/running' in |return 'is running' in |" \
        -e "s|ret = _default_runlevel|return _default_runlevel|" \
     /usr/lib/python2.7/dist-packages/salt/modules/upstart.py
 
+# Workaround for: https://github.com/salt-formulas/reclass/issues/77
+sed -i -e 's|\(ignore_overwritten_missing_references\)defaults.|\1|' \
+    /usr/local/lib/python2.7/dist-packages/reclass/settings.py
+
 # Remove broken symlinks in /srv/salt, silences recurring warnings
 find -L /srv/salt /srv/salt/env/prd/_* -maxdepth 1 -type l -delete