Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #780, disabled configs prevents finding missing instances #781

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions sarracenia/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,18 @@ 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.
continue
Expand Down Expand Up @@ -556,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