diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index 4c07b88993..3842041214 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -616,11 +616,11 @@ def prep_trans_tar(opts, chunks, file_refs): break files = file_client.cache_dir(name, env, True) if files: - for file in files: + for filename in files: tgt = os.path.join( env_root, short, - file[file.find(short) + len(short):], + filename[filename.find(short) + len(short):], ) tgt_dir = os.path.dirname(tgt) if not os.path.isdir(tgt_dir): diff --git a/salt/client/ssh/state.py b/salt/client/ssh/state.py index 7c48ed6633..9a31b797d6 100644 --- a/salt/client/ssh/state.py +++ b/salt/client/ssh/state.py @@ -128,11 +128,11 @@ def prep_trans_tar(opts, chunks, file_refs): break files = file_client.cache_dir(name, env, True) if files: - for file in files: + for filename in files: tgt = os.path.join( env_root, short, - file[file.find(short) + len(short):], + filename[filename.find(short) + len(short):], ) tgt_dir = os.path.dirname(tgt) if not os.path.isdir(tgt_dir):