mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #30211 from techhat/tmppath
Execute choot on the correct path
This commit is contained in:
commit
f23f0f30d4
1 changed files with 4 additions and 3 deletions
|
@ -57,7 +57,8 @@ def prep_bootstrap(mpt):
|
|||
fp_ = os.path.join(fpd_, os.path.basename(bs_))
|
||||
# Copy script into tmp
|
||||
shutil.copy(bs_, fp_)
|
||||
return fp_
|
||||
tmppath = fpd_.replace(mpt, '')
|
||||
return fp_, tmppath
|
||||
|
||||
|
||||
def _mount(path, ftype):
|
||||
|
@ -237,11 +238,11 @@ def _install(mpt):
|
|||
'''
|
||||
|
||||
_check_resolv(mpt)
|
||||
boot_ = (prep_bootstrap(mpt)
|
||||
boot_, tmppath = (prep_bootstrap(mpt)
|
||||
or salt.syspaths.BOOTSTRAP)
|
||||
# Exec the chroot command
|
||||
cmd = 'if type salt-minion; then exit 0; '
|
||||
cmd += 'else sh {0} -c /tmp; fi'.format(salt.syspaths.BOOTSTRAP)
|
||||
cmd += 'else sh {0} -c /tmp; fi'.format(os.path.join(tmppath, 'bootstrap-salt.sh'))
|
||||
return not __salt__['cmd.run_chroot'](mpt, cmd, python_shell=True)['retcode']
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue