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

View File

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