Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Feb 15, 2017
1 parent f2193d5 commit 5b69a7b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions malcolm/controllers/managercontroller.py
Expand Up @@ -121,16 +121,6 @@ def create_attributes(self):
assert os.path.isdir(self.params.configDir), \
"%s is not a directory" % self.params.configDir

def do_initial_reset(self):
self.process.spawn(self._initial_reset)

def _initial_reset(self):
self.reset()
if self.params.defaultConfig:
self.load_layout(self.params.defaultConfig)
else:
self.load_structure = self._save_to_structure()

def set_layout(self, value):
part_info = self.run_hook(self.ReportOutports, self.create_part_tasks())
part_info = self.run_hook(
Expand All @@ -152,6 +142,12 @@ def do_reset(self):
self.set_layout(Table(self.layout.meta))
# List the configDir and add to choices
self._set_layout_names()
# If we have no load_structure (initial reset) define one
if self.load_structure is None:
if self.params.defaultConfig:
self.load_layout(self.params.defaultConfig)
else:
self.load_structure = self._save_to_structure()

@method_writeable_in(sm.READY)
def edit(self):
Expand Down

0 comments on commit 5b69a7b

Please sign in to comment.