'Run a StarCluster plugin.
plugin - an instance of the plugin\'s class
name - a user-friendly label for the plugin
method_name - the method to run within the plugin (default: "run")
node - optional node to pass as first argument to plugin method (used
for on_add_node/on_remove_node)'

def run_plugin(self, plugin, name='', method_name='run', node=None):

    plugin_name = (name or getattr(plugin, '__name__', utils.get_fq_class_name(plugin)))
    try:
        func = getattr(plugin, method_name, None)
        if (not func):
            log.warn(('Plugin    %s    has    no    %s    method...skipping' % (plugin_name, method_name)))
            return
        args = [self.nodes, self.master_node, self.cluster_user, self.cluster_shell, self.volumes]
        if node:
            args.insert(0, node)
        log.info(('Running    plugin    %s' % plugin_name))
        func(*args)
    except NotImplementedError:
        log.debug(('method    %s    not    implemented    by    plugin    %s' % (method_name, plugin_name)))
    except exception.MasterDoesNotExist:
        raise
    except KeyboardInterrupt:
        raise
    except Exception:
        log.error(("Error    occured    while    running    plugin    '%s':" % plugin_name))
        raise
