NFVBENCH-5 NFVBENCH-39 Fix long prep time with large number of flows
[nfvbench.git] / nfvbench / config_plugin.py
index ed6b3c6..78c2ebb 100644 (file)
@@ -36,6 +36,14 @@ class ConfigPluginBase(object):
     def get_config(self):
         """Returns updated default configuration file."""
 
+    def set_config(self, config):
+        """This method is called when the config has changed after this instance was initialized.
+
+        This is needed in teh frequent case where the main config is changed in a copy and to
+        prevent this instance to keep pointing to the old copy of the config
+        """
+        self.config = config
+
     @abc.abstractmethod
     def get_openstack_spec(self):
         """Returns OpenStack specs for host."""
@@ -45,7 +53,7 @@ class ConfigPluginBase(object):
         """Returns RunSpec for given platform."""
 
     @abc.abstractmethod
-    def validate_config(self, cfg):
+    def validate_config(self, cfg, openstack_spec):
         """Validate config file."""
 
     @abc.abstractmethod
@@ -77,7 +85,7 @@ class ConfigPlugin(ConfigPluginBase):
         """Returns RunSpec for given platform."""
         return specs.RunSpec(self.config.no_vswitch_access, openstack_spec)
 
-    def validate_config(self, config):
+    def validate_config(self, config, openstack_spec):
         pass
 
     def prepare_results_config(self, cfg):