1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Mon, 21 Aug 2017 02:03:01 +0200
3 Subject: [PATCH] seedng: module: Sync salt version
5 salt custom py module seedng.py should use the same Salt version
6 when preinstalling minion for salt-controlled VMs via bootstrap
9 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
12 diff --git a/_modules/seedng.py b/_modules/seedng.py
13 --- a/_modules/seedng.py
14 +++ b/_modules/seedng.py
16 boot_, tmppath = (prep_bootstrap(mpt)
17 or salt.syspaths.BOOTSTRAP)
18 # Exec the chroot command
19 + arg = 'stable {0}'.format('.'.join(salt.version.__version__.split('.')[:2]))
20 cmd = 'if type salt-minion; then exit 0; '
21 - cmd += 'else sh {0} -c /tmp; fi'.format(os.path.join(tmppath, 'bootstrap-salt.sh'))
22 + cmd += 'else sh {0} -c /tmp {1}; fi'.format(
23 + os.path.join(tmppath, 'bootstrap-salt.sh'), arg)
24 return not __salt__['cmd.run_chroot'](mpt, cmd, python_shell=True)['retcode']