Пример #1
0
 def __init__(self, plugin_name, config):
     utils.ConfEntry.__init__(self, plugin_name, config)
     self.components = ['name', 'interval', 'report_name']
     for c in self.components:
         try:
             self.__dict__[c] = self.config[plugin_name][c]
         except KeyError:
             raise utils.ConfOptionError("{} is missing {} field".format(
                 plugin_name, c))
         if not self.__dict__[c]:
             raise utils.ConfOptionError("{}: {} has no value set".format(
                 plugin_name, c))
         if c == 'other_config':
             try:
                 self.__dict__[c] = literal_eval("{}".format(
                     self.config[plugin_name][c]))
             except:
                 raise utils.ConfFormatError(
                     "{}: {} value has wrong format".format(
                         plugin_name, c, self.__dict__[c]))
     self.table = 'FCM_Collector_Config'
     self.insert_cmd = []
     self.gen_insert_cmd()
     self.delete_cmd = []
     self.gen_delete_cmd()
Пример #2
0
 def __init__(self, plugin_name, config):
     utils.ConfEntry.__init__(self, plugin_name, config)
     self.components = [
         'handler',
         'if_name',
         'pkt_capt_filter',
         'plugin',
         'other_config'
     ]
     for c in self.components:
         try:
             self.__dict__[c] = self.config[plugin_name][c]
         except KeyError:
             raise utils.ConfOptionError(
                 "{} is missing {} field".format(plugin_name, c))
         if not self.__dict__[c]:
             raise utils.ConfOptionError(
                 "{}: {} has no value set".format(plugin_name, c))
         if c == 'other_config':
             try:
                 self.__dict__[c] = literal_eval("{}".format(
                     self.config[plugin_name][c]))
             except:
                 raise utils.ConfFormatError(
                     "{}: {} value has wrong format".format(plugin_name,
                                                            c,
                                                            self.__dict__[c]))
     self.table = 'Flow_Service_Manager_Config'
     self.insert_cmd = []
     self.gen_insert_cmd()
     self.delete_cmd = []
     self.gen_delete_cmd()
Пример #3
0
    def __init__(self, iface_name, config):
        utils.ConfEntry.__init__(self, iface_name, config)
        self.components = ['if_name', 'bridge', 'of_port']

        for c in self.components:
            try:
                self.__dict__[c] = self.config[iface_name][c]
            except KeyError:
                raise utils.ConfOptionError("{} is missing {} field".format(
                    iface_name, c))
            if not self.__dict__[c]:
                raise utils.ConfOptionError("{}: {} has no value set".format(
                    plugin_name, c))

        self.insert_cmd = []
        self.gen_insert_cmd()
        self.delete_cmd = []
        self.gen_delete_cmd()
Пример #4
0
    def __init__(self, tag_name, config):
        utils.ConfEntry.__init__(self, tag_name, config)
        self.components = ['name', 'cloud_value', 'device_value']
        for c in self.components:
            try:
                self.__dict__[c] = self.config[tag_name][c]
            except KeyError:
                raise utils.ConfOptionError("{} is missing {} field".format(
                    tag_name, c))
            if c == 'name' and not self.__dict__[c]:
                raise utils.ConfOptionError("{}: {} has no value set".format(
                    tag_name, c))
            if c != 'name':
                self.__dict__[c] = literal_eval("{}".format(
                    self.config[tag_name][c]))

        self.table = 'Openflow_Tag'
        self.insert_cmd = []
        self.gen_insert_cmd()
        self.delete_cmd = []
        self.gen_delete_cmd()
Пример #5
0
    def __init__(self, openflow_name, config):
        utils.ConfEntry.__init__(self, openflow_name, config)
        self.components = [
            'token',
            'bridge',
            'table',
            'priority',
            'rule',
            'action'
        ]
        for c in self.components:
            try:
                self.__dict__[c] = self.config[openflow_name][c]
            except KeyError:
                raise utils.ConfOptionError(
                    "{} is missing {} field".format(openflow_name, c))

        self.ovs_table = 'Openflow_Config'
        self.insert_cmd = []
        self.gen_insert_cmd()
        self.delete_cmd = []
        self.gen_delete_cmd()