Update skills manifest if a skill is reloaded.
When a skill is reloaded it is quite possible that a new skill gid has
been assigned to it and the backend needs to be informed of the change.
@@ -171,15 +171,21 @@ class SkillManager(Thread):
def _reload_modified_skills(self):
"""Handle reload of recently changed skill(s)"""
+ reload_occured = False
for skill_dir in self._get_skill_directories():
try:
skill_loader = self.skill_loaders.get(skill_dir)
if skill_loader is not None and skill_loader.reload_needed():
skill_loader.reload()
+ reload_occured = True
except Exception as e:
LOG.exception('Unhandled exception occured while '
'reloading {}'.format(skill_dir))
+ if reload_occured:
+ # If a reload occured a skill gid may have changed.
+ self.skill_updater.post_manifest()
+
def _load_new_skills(self):
"""Handle load of skills installed since startup."""
for skill_dir in self._get_skill_directories():
