mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix linter
This commit is contained in:
parent
7492c2f7c7
commit
5dd8f8eabe
1 changed files with 3 additions and 1 deletions
|
@ -2276,13 +2276,15 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
else:
|
||||
modulec_path = os.path.join(RUNTIME_VARS.CODE_DIR, 'pip.pyc')
|
||||
unzip_path = os.path.join(RUNTIME_VARS.TMP, 'issue-56131.txt')
|
||||
|
||||
def clean_paths(paths):
|
||||
for path in paths:
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
log.warn("Path not found: %s", path)
|
||||
with open(module_path, 'w') as fp:
|
||||
|
||||
with salt.utils.files.fopen(module_path, 'w') as fp:
|
||||
fp.write('raise ImportError("No module named pip")')
|
||||
self.addCleanup(clean_paths, [unzip_path, module_path, modulec_path])
|
||||
assert not os.path.exists(unzip_path)
|
||||
|
|
Loading…
Add table
Reference in a new issue