Merge branch '2014.7' into send_ext_mods

Conflicts:
	salt/client/ssh/__init__.py
This commit is contained in:
Thomas S Hatch 2014-10-14 23:59:45 -06:00
commit c4924f727b
3 changed files with 16 additions and 2 deletions

View File

@ -727,13 +727,15 @@ OPTIONS.checksum = '{3}'
OPTIONS.hashfunc = '{4}'
OPTIONS.version = '{5}'
OPTIONS.ext_mods = '{6}'
ARGS = {7}\n'''.format(self.minion_config,
OPTIONS.wipe = {7}
ARGS = {8}\n'''.format(self.minion_config,
RSTR,
self.thin_dir,
thin_sum,
'sha1',
salt.__version__,
self.mods.get('version'),
'True' if self.opts.get('wipe_ssh') else 'False',
self.argv)
py_code = SSH_PY_SHIM.replace('#%%OPTS', arg_str)
py_code_enc = py_code.encode('base64').replace('\n', '_')

View File

@ -175,7 +175,12 @@ def main(argv):
sys.stdout.flush()
sys.stderr.write(OPTIONS.delimiter + '\n')
sys.stderr.flush()
os.execv(sys.executable, salt_argv)
if OPTIONS.wipe:
import subprocess
subprocess.call(salt_argv)
shutil.rmtree(OPTIONS.saltdir)
else:
os.execv(sys.executable, salt_argv)
if __name__ == '__main__':
sys.exit(main(sys.argv))

View File

@ -2190,6 +2190,13 @@ class SaltSSHOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
help=('Return the data from minions as a group after they '
'all return.')
)
self.add_option(
'-w', '--wipe',
default=False,
action='store_true',
dest='wipe_ssh',
help='Remove the deployment of the salt files when done executing.',
)
auth_group = optparse.OptionGroup(
self, 'Authentication Options',