# adding the avoided pids filtered above (avoid_kill) to allow users keep process
# alive when using besides ssh connections
kill_pids = set(pids_temp.items()) - set(pids.items())
- kill_pids = ' '.join(list(dict(kill_pids).keys()))
+ # py2/py3 : keep it simple
+ kill_pids = ' '.join(kill_pids)
# removing pids from beside connections and its process
kill_pids = kill_pids.split(' ')
src = f.name
# If dst files should not be overwritten, check that the files do not
- # exits already
+ # exist already
if isinstance(src, str):
- src = list(map(str.strip, src.split(";")))
+ src = [s.strip() for s in src.split(";")]
if overwrite == False:
src = self.filter_existing_files(src, dst)
if len(src) > 1 else {dst: src[0]}
command = []
- for d in list(dests.keys()):
+ for d in dests:
command.append(" [ -f {dst} ] && echo '{dst}' ".format(dst=d) )
command = ";".join(command)
(out, err), proc = self.execute(command, retry = 1, with_lock = True)
- for d in list(dests.keys()):
+ for d in dests:
if out.find(d) > -1:
del dests[d]
if not dests:
return []
+ # list(..) here added by 2to3 - leaving for safety
return list(dests.values())