Esempio n. 1
0
    def _save_config(self):
      config = Config()
      config.plugin_del_config(self.__class__.__name__)
      i = 0
      for command in [ self.cmd_list[key] for key in sorted(self.cmd_list.keys()) ] :
        enabled = command['enabled']
        name = command['name']
        command = command['command']
       
        item = {}
        item['enabled'] = enabled
        item['name'] = name
        item['command'] = command
        item['position'] = i

        config.plugin_set(self.__class__.__name__, name, item)
        i = i + 1
      config.save()
Esempio n. 2
0
    def _save_config(self):
      log_debug("_save_config")
      config = Config()
      config.plugin_del_config(self.__class__.__name__)
      i = 0
      for ssh_conf in self.cmd_list :
        ip = ssh_conf['ip']
        user = ssh_conf['user']
        port = ssh_conf['port']
        last_time = ssh_conf['last_time']
        passwd = ssh_conf['passwd']

        item = { 'ip': ip, 'user': user, 'port': port, 'last_time': last_time, 'passwd': passwd}
        ssh_key = user+"@"+ip
        config.plugin_set(self.__class__.__name__, ssh_key, item)

        i = i + 1
      config.save()
    def _save_config(self):
      config = Config()
      config.plugin_del_config(self.__class__.__name__)
      i = 0
      for command in [ self.cmd_list[key] for key in sorted(self.cmd_list.keys()) ] :
        enabled = command['enabled']
        name = command['name']
        command = command['command']
       
        item = {}
        item['enabled'] = enabled
        item['name'] = name
        item['command'] = command
        item['position'] = i

        config.plugin_set(self.__class__.__name__, name, item)
        i = i + 1
      config.save()
Esempio n. 4
0
    def _save_config(self):
        config = Config()
        config.plugin_del_config(self.__class__.__name__)
        i = 0
        for command in [
                self.cmd_list[key] for key in sorted(self.cmd_list.keys())
        ]:
            enabled = command['enabled']
            regexp = command['regexp']
            command = command['command']

            item = {}
            item['enabled'] = enabled
            item['regexp'] = regexp
            item['command'] = command
            item['position'] = i

            config.plugin_set(self.__class__.__name__, regexp, item)
            i = i + 1
        config.save()
        self._load_configured_handlers()