change EOF string, set readline to stdin

This still does not work, sys.stdin will not wait to accept anything
because of the way the pipe reads
This commit is contained in:
Thomas S Hatch 2014-10-11 23:44:45 -06:00
parent c5857d13a9
commit fdbb24eca6
2 changed files with 5 additions and 5 deletions

View File

@ -348,8 +348,8 @@ class Shell(object):
'auto accept run salt-ssh with the -i '
'flag:\n{0}').format(stdout)
return ret_stdout, '', 254
elif stdout and stdout == 'ext_mod':
mods_raw = json.dumps(self.mods, separators=(',',':')) + 'EOF_||'
elif stdout and stdout == 'ext_mods':
mods_raw = json.dumps(self.mods, separators=(',',':')) + '|_E|0|'
term.sendline(mods_raw)
if not term.isalive():
while True:

View File

@ -134,9 +134,9 @@ def unpack_thin(thin_path):
def get_modules():
glob = ''
while True:
sys.stdout.write("{0}\next_mods\n".format(OPTIONS.delimiter))
glob += raw_input()
if glob.endswith('EOF_||'):
sys.stdout.write('ext_mods')
glob += sys.stdin.readline()
if glob.endswith('|_E|0|'):
break
ext_mods = json.loads(glob[:-6])
write_modules(ext_mods)