def _delegator_iter(self, method_name, *args, **kwargs): """ Call the `method_name` on all the registered conductor plug-ins Exception Handling as dictated by policy @type : C{String} @param : The name of the method to call on the plug-in """ LOG.debug("Delegating '%s' with args: '%s', kwargs: '%s'" % (method_name, args, kwargs)) for plugin in self._plugins: with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): if hasattr(plugin, method_name): method = getattr(plugin, method_name) yield method(*args, **kwargs)
def _delegator_iter(self, method_name, *args, **kwargs): """ Call the `method_name` on all the registered publishers Exception Handling as dictated by policy @type method_name: C{str} @param method_name: The name of the method to call on the Publisher """ LOG.debug("Delegating '%s' with args: '%s', kwargs: '%s'" %(method_name, args, kwargs)) for publisher in self._publishers: with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): if hasattr(publisher, method_name): method = getattr(publisher, method_name) yield method(*args, **kwargs)
def _delegator_iter(self, method_name, *args, **kwargs): """ Call the `method_name` on all the registered publishers Exception Handling as dictated by policy @type method_name: C{str} @param method_name: The name of the method to call on the Publisher """ LOG.debug("Delegating '%s' with args: '%s', kwargs: '%s'" % (method_name, args, kwargs)) for publisher in self._publishers: with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): if hasattr(publisher, method_name): method = getattr(publisher, method_name) yield method(*args, **kwargs)
def _delegator_iter(self, method_name, *args, **kwargs): """ Call the `method_name` on all the registered conductor plug-ins Exception Handling as dictated by policy @type : C{String} @param : The name of the method to call on the plug-in """ LOG.debug("Delegating '%s' with args: '%s', kwargs: '%s'" %(method_name, args, kwargs)) for plugin in self._plugins: with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): if hasattr(plugin, method_name): method = getattr(plugin, method_name) yield method(*args, **kwargs)
def __init__(self, options): """ ConductorPlugins initialization @type options: C{Object} @param options: TestRunData object """ root_dir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0] plugin_dir = os.path.join(root_dir, "plug-ins") self._plugins = [] LOG.debug("plugin_dir: %s" % plugin_dir) LOG.debug(plugins_iter(plugin_dir, "ots.plugin.conductor")) for plugin_klass in plugins_iter(plugin_dir, "ots.plugin.conductor"): LOG.debug("Conductor plug-in found: '%s'" % plugin_klass) with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): plugin = plugin_klass(options) LOG.debug("Adding a conductor plug-in: '%s'" % plugin) self._plugins.append(plugin)
def __init__(self, options): """ ConductorPlugins initialization @type options: C{Object} @param options: TestRunData object """ root_dir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0] plugin_dir = os.path.join(root_dir, "plug-ins") self._plugins = [] LOG.debug("plugin_dir: %s" % plugin_dir) LOG.debug(plugins_iter(plugin_dir, "ots.plugin.conductor")) for plugin_klass in plugins_iter(plugin_dir, "ots.plugin.conductor"): LOG.debug("Conductor plug-in found: '%s'" % plugin_klass) with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): plugin = plugin_klass(options) LOG.debug("Adding a conductor plug-in: '%s'" % plugin) self._plugins.append(plugin)
def __init__(self, request_id, testrun_uuid, sw_product = None, image = None, **kwargs): """ @type request_id: C{str} @param request_id: An identifier for the request from the client @type testrun_uuid: C{str} @param testrun_uuid: The unique identifier for the testrun @type sw_product: C{str} @param sw_product: Name of the sw product this testrun belongs to @type image: C{str} @param image: The URL of the image """ root_dir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0] plugin_dir = os.path.join(root_dir, "plugins") self._publishers = [] LOG.debug(root_dir) LOG.debug(plugin_dir) LOG.debug(plugins_iter(plugin_dir, "ots.publisher_plugin")) for publisher_klass in plugins_iter(plugin_dir, "ots.publisher_plugin"): LOG.debug("Publisher found: '%s'"%(publisher_klass)) with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): publisher = publisher_klass(request_id, testrun_uuid, sw_product, image, **kwargs) LOG.debug("Adding publisher: '%s'"%(publisher)) self._publishers.append(publisher) self._share_uris(testrun_uuid) DTO_SIGNAL.connect(self._callback)
def __init__(self, request_id, testrun_uuid, sw_product=None, image=None, **kwargs): """ @type request_id: C{str} @param request_id: An identifier for the request from the client @type testrun_uuid: C{str} @param testrun_uuid: The unique identifier for the testrun @type sw_product: C{str} @param sw_product: Name of the sw product this testrun belongs to @type image: C{str} @param image: The URL of the image """ root_dir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0] plugin_dir = os.path.join(root_dir, "plugins") self._publishers = [] LOG.debug(root_dir) LOG.debug(plugin_dir) LOG.debug(plugins_iter(plugin_dir, "ots.publisher_plugin")) for publisher_klass in plugins_iter(plugin_dir, "ots.publisher_plugin"): LOG.debug("Publisher found: '%s'" % (publisher_klass)) with plugin_exception_policy(self.SWALLOW_EXCEPTIONS): publisher = publisher_klass(request_id, testrun_uuid, sw_product, image, **kwargs) LOG.debug("Adding publisher: '%s'" % (publisher)) self._publishers.append(publisher) self._share_uris(testrun_uuid) DTO_SIGNAL.connect(self._callback)