Revert "patches: Drop salt ver sync patch, now upstream" 69/49969/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 3 Jan 2018 19:08:06 +0000 (20:08 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 3 Jan 2018 19:09:58 +0000 (20:09 +0100)
Unlike nightly dist, stable/2017.12 distributions of salt formulas
repo do not yet include this change, so bring it back.

This reverts commit 8fbafdf8a665fb8fff4d6f9f14c343e109c122ec.

Change-Id: I7f7011750d385a28f4653faeeb74edb1cac1bcf2
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/patches/0009-seedng-module-Sync-salt-version.patch [new file with mode: 0644]
mcp/patches/patches.list

diff --git a/mcp/patches/0009-seedng-module-Sync-salt-version.patch b/mcp/patches/0009-seedng-module-Sync-salt-version.patch
new file mode 100644 (file)
index 0000000..d116c81
--- /dev/null
@@ -0,0 +1,34 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Mon, 21 Aug 2017 02:03:01 +0200
+Subject: [PATCH] seedng: module: Sync salt version
+
+salt custom py module seedng.py should use the same Salt version
+when preinstalling minion for salt-controlled VMs via bootstrap
+script.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+
+diff --git a/_modules/seedng.py b/_modules/seedng.py
+--- a/_modules/seedng.py
++++ b/_modules/seedng.py
+@@ -256,8 +256,10 @@
+     boot_, tmppath = (prep_bootstrap(mpt)
+              or salt.syspaths.BOOTSTRAP)
+     # Exec the chroot command
++    arg = 'stable {0}'.format('.'.join(salt.version.__version__.split('.')[:2]))
+     cmd = 'if type salt-minion; then exit 0; '
+-    cmd += 'else sh {0} -c /tmp; fi'.format(os.path.join(tmppath, 'bootstrap-salt.sh'))
++    cmd += 'else sh {0} -c /tmp {1}; fi'.format(
++        os.path.join(tmppath, 'bootstrap-salt.sh'), arg)
+     return not __salt__['cmd.run_chroot'](mpt, cmd, python_shell=True)['retcode']
+
+
index 284f1bc..2f9d6bb 100644 (file)
@@ -14,5 +14,6 @@
 /usr/share/salt-formulas/env: 0007-network.interface-Fix-ifup-OVS-port-with-route.patch
 /usr/share/salt-formulas/env: 0008-Handle-file_recv-option.patch
 /usr/share/salt-formulas/env: 0009-controller-Use-keystoneclient-to-check-project-ID.patch
+/usr/share/salt-formulas/env: 0009-seedng-module-Sync-salt-version.patch
 /usr/share/salt-formulas/env: 0010-maas-region-allow-timeout-override.patch
 /usr/share/salt-formulas/env: 0012-linux.storage.lvm-Disable-filter.patch