# Buggy code
def RunModeRegistryPlugin(self):
    """Run against a set of Registry plugins."""
    # TODO: Add support for splitting the output to separate files based on
    # each plugin name.
    plugin_list = self.plugin_names.split(",")
    registry_helpers = self._front_end.GetRegistryHelpers(plugin_names=plugin_list)

    plugins = []
    for plugin_name in self.plugin_names:
        plugins.extend(self._front_end.GetRegistryPlugins(plugin_name))
    plugin_list = [plugin.NAME for plugin in plugins]

    # In order to get all the Registry keys we need to expand
    # them, but to do so we need to open up one hive so that we
    # create the reg_cache object, which is necessary to fully
    # expand all keys.
    if not registry_helpers:
        return

    registry_helper = registry_helpers[0]
    key_paths = []
    try:
        registry_helper.Open()
        parser_mediator = self._front_end.CreateParserMediator()

        plugins = self._front_end.registry_plugin_list

        # Get all the appropriate keys from these plugins.
        key_paths = plugins.GetExpandedKeyPaths(
            parser_mediator,
            reg_cache=registry_helper.reg_cache,
            plugin_names=plugin_list,
        )
    finally:
        registry_helper.Close()

    for registry_helper in registry_helpers:
        parsed_data = self._front_end.ParseRegistryFile(
            registry_helper, key_paths=key_paths, use_plugins=plugin_list
        )
        self._PrintParsedRegistryFile(parsed_data, registry_helper)


# Traceback (AttributeError)
Traceback (most recent call last):
File "/usr/local/bin/preg.py", line 5, in <module>
pkg_resources.run_script('plaso==1.3.0-20150715', u'preg.py')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 492, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1350, in run_script
execfile(script_filename, namespace, namespace)
File "/Library/Python/2.7/site-packages/plaso-1.3.0_20150715-py2.7.egg/EGG-INFO/scripts/preg.py", line 1711, in <module>
if not Main():
File "/Library/Python/2.7/site-packages/plaso-1.3.0_20150715-py2.7.egg/EGG-INFO/scripts/preg.py", line 1700, in Main
tool.RunModeRegistryPlugin()
File "/Library/Python/2.7/site-packages/plaso-1.3.0_20150715-py2.7.egg/EGG-INFO/scripts/preg.py", line 865, in RunModeRegistryPlugin
plugin_list = self.plugin_names.split(u',')
AttributeError: 'list' object has no attribute 'split'

# Fixed code
def RunModeRegistryPlugin(self):
    """Run against a set of Registry plugins."""
    # TODO: Add support for splitting the output to separate files based on
    # each plugin name.
    registry_helpers = self._front_end.GetRegistryHelpers(
        plugin_names=self.plugin_names
    )

    plugins = []
    for plugin_name in self.plugin_names:
        plugins.extend(self._front_end.GetRegistryPlugins(plugin_name))
    plugin_list = [plugin.NAME for plugin in plugins]

    # In order to get all the Registry keys we need to expand
    # them, but to do so we need to open up one hive so that we
    # create the reg_cache object, which is necessary to fully
    # expand all keys.
    if not registry_helpers:
        return

    registry_helper = registry_helpers[0]
    key_paths = []
    try:
        registry_helper.Open()
        parser_mediator = self._front_end.CreateParserMediator()

        plugins = self._front_end.registry_plugin_list

        # Get all the appropriate keys from these plugins.
        key_paths = plugins.GetExpandedKeyPaths(
            parser_mediator,
            reg_cache=registry_helper.reg_cache,
            plugin_names=plugin_list,
        )
    finally:
        registry_helper.Close()

    for registry_helper in registry_helpers:
        parsed_data = self._front_end.ParseRegistryFile(
            registry_helper, key_paths=key_paths, use_plugins=plugin_list
        )
        self._PrintParsedRegistryFile(parsed_data, registry_helper)