Пример #1
0
 def createFromComponentDict(cls, workerCtx, props):
     return super(MonitorProperties, cls).createFromComponentDict(
         workerCtx,
         props,
         scanPeriod=props.get("scan-period", None),
         setup_callback=props.get("setup-callback", None),
         pathAttr=PathAttributes.createFromComponentProperties(props),
     )
Пример #2
0
 def do_setup(self):
     try:
         properties = self.config['properties']
         self._local = Local.createFromComponentProperties(properties)
         self._pathAttr = PathAttributes.createFromComponentProperties(properties)
         for s in properties.get("named-profile", []):
             profile, path, active = s.split('!')
             vpath = VirtualPath(path)
             active = bool(int(active))
             self.profiles_virtualbase[profile] = vpath
             self.uiState.setitem('virtbase-map', profile, str(vpath))
             self.uiState.append('monitored-profiles', profile)
             if active:
                 self.active_profiles.append(profile)
                 self.uiState.append('active-profiles', profile)
             else:
                 self.http_profiles.append(profile)
                 self.uiState.append('http-profiles', profile)
     except:
         return fail(self._unexpected_error(task="component setup"))