Skip to content

Commit

Permalink
Change to using absolute paths instead of relative and .. inside find…
Browse files Browse the repository at this point in the history
…_missing_instances_dir
  • Loading branch information
reidsunderland committed Oct 16, 2023
1 parent 0640aa5 commit 0b004de
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions sarracenia/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,19 +517,20 @@ def _find_missing_instances_dir(self, dir):
return
os.chdir(dir)
for c in self.components:
if os.path.isdir(c):
c_dir = os.path.join(dir, c)
if os.path.isdir(c_dir):
if c not in self.configs: continue
os.chdir(c)
os.chdir(c_dir)
for cfg in os.listdir():
if cfg[0] == '.': continue

if cfg not in self.configs[c]: continue

if os.path.isdir(cfg):
os.chdir(cfg)

cfg_dir = os.path.join(c_dir, cfg)
if os.path.isdir(cfg_dir):
os.chdir(cfg_dir)

if os.path.exists("disabled"): # double check, if disabled should ignore state.
os.chdir('..')
continue

for filename in os.listdir():
Expand Down Expand Up @@ -557,8 +558,8 @@ def _find_missing_instances_dir(self, dir):
if i not in self.procs:
if i != 0:
missing.append([c,cfg,i])
os.chdir('..')
os.chdir('..')
os.chdir(c_dir) # back to component dir containing configs
os.chdir(dir) # back to dir containing components

self.missing.extend(missing)

Expand Down

0 comments on commit 0b004de

Please sign in to comment.