X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fnode.py;fp=src%2Fnepi%2Fresources%2Flinux%2Fnode.py;h=c10bc584388093d9c23e9ae45cf801a44bba84ab;hb=b4af9a40867beff8660612fe20d3838cb375f159;hp=7558475c35a2632583e2603be8281a2eec4c84de;hpb=b3292d8429f07d0e9d21a3ec2d81dbc4b18332d1;p=nepi.git diff --git a/src/nepi/resources/linux/node.py b/src/nepi/resources/linux/node.py index 7558475c..c10bc584 100644 --- a/src/nepi/resources/linux/node.py +++ b/src/nepi/resources/linux/node.py @@ -489,7 +489,8 @@ class LinuxNode(ResourceManager): # 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(' ') @@ -773,9 +774,9 @@ class LinuxNode(ResourceManager): 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) @@ -1178,19 +1179,20 @@ class LinuxNode(ResourceManager): 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())