def add_plugin_dir(self, path):
        # If single string, convert to list
        if isinstance(path, basestring):
            path = set([path])
        else:
            path = set(path)

        girder_plugin_dir = set([os.path.join(self.module.params['girder_dir'],
                                              "plugins")])

        self.message['debug']['path'] = list(path)
        # Add the section if it doesn't alraedy exist
        if not self.config.has_section('plugins'):
            self.config.add_section('plugins')

        try:
            plugin_dirs = set(self.config.get("plugins",
                                              "plugin_directory").split(":"))

            # Remove girder_plugin_dir if it exists
            plugin_dirs = plugin_dirs - girder_plugin_dir

            # If path is not a subset of plugin_dirs we
            # are about to affect a change.
            self.changed = not set(path) <= set(plugin_dirs)
        except cp.NoOptionError:
            plugin_dirs = set([])
            self.changed = True

        if self.changed:
            plugin_dirs |= path
            # Add girder_plugin_dir back in at the front of the list
            plugin_dirs = list(girder_plugin_dir) + list(plugin_dirs)

            self.config.set("plugins", "plugin_directory",
                            "\"" + ":".join(plugin_dirs) + "\"")

        return
dataset/ETHPy150Open Kitware/minerva/ansible/library/girder_plugin_dir.py/GirderPluginDirModule.add_plugin_dir/original