diff --git a/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb
index fcbe8ae..2aa5560 100644
--- a/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb
+++ b/meta-phosphor/common/recipes-phosphor/dump/phosphor-debug-collector.bb
@@ -107,12 +107,10 @@
                 ${D}${dreport_include_dir}/
 }
 
-# Parse the scripts in base directory, read config value
+# Make the links for a single user plugin script
 # Create user directories based on the dump type value in the config section
 # Create softlinks for the base scripts in the user directories
-python install_dreport_user_scripts() {
-    from shutil import copyfile
-    import stat
+def install_dreport_user_script(script_path, d):
     import re
     import configparser
 
@@ -121,44 +119,52 @@
     conf_dir  = d.getVar('D', True) + d.getVar('dreport_conf_dir', True)
     confsource = os.path.join(conf_dir, "dreport.conf")
     configure.read(confsource)
-    section = "DumpType"
-    options = configure.options(section)
 
-    #open the script from base dir and read the config value
+    config = ("config:")
+    section = "DumpType"
+    dreport_dir = d.getVar('D', True) + d.getVar('dreport_dir', True)
+
+    script = os.path.basename(script_path)
+    srclink = os.path.join(d.getVar('dreport_plugin_dir', True), script)
+
+    file = open(script_path, "r")
+
+    for line in file:
+        if not config in line:
+            continue
+        revalue = re.search('[0-9]+.[0-9]+', line)
+        if not revalue:
+            bb.warn("Invalid format for config value =%s" % line)
+            continue
+        parse_value = revalue.group(0)
+        config_values = re.split('\W+', parse_value, 1)
+        if(len(config_values) != 2):
+            bb.warn("Invalid config value=%s" % parse_value)
+            break;
+        priority = config_values[1]
+        types = [int(d) for d in str(config_values[0])]
+        for type in types:
+            if not configure.has_option(section, str(type)):
+                bb.warn("Invalid dump type id =%s" % (str(type)))
+                continue
+            typestr = configure.get(section, str(type))
+            destdir = os.path.join(dreport_dir, ("pl_" + typestr + ".d"))
+            if not os.path.exists(destdir):
+                os.makedirs(destdir)
+            linkname = "E" + priority + script
+            destlink = os.path.join(destdir, linkname)
+            os.symlink(srclink, destlink)
+
+#Make the links for all the plugins
+python install_dreport_user_scripts() {
+
     source = d.getVar('S', True)
     source_path = os.path.join(source, "tools", "dreport.d", "plugins.d")
     scripts = os.listdir(source_path)
-    dreport_dir= d.getVar('D', True) + d.getVar('dreport_dir', True)
-    config = ("config:")
+
     for script in scripts:
         srcname = os.path.join(source_path, script)
-        srclink = os.path.join(d.getVar('dreport_plugin_dir', True), script)
-        file = open(srcname, "r")
-        for line in file:
-            if not config in line:
-                continue
-            revalue = re.search('[0-9]+.[0-9]+', line)
-            if not revalue:
-                bb.warn("Invalid format for config value =%s" % line)
-                continue
-            parse_value = revalue.group(0)
-            config_values = re.split('\W+', parse_value, 1)
-            if(len(config_values) != 2):
-                bb.warn("Invalid config value=%s" % parse_value)
-                break;
-            priority = config_values[1]
-            types = [int(d) for d in str(config_values[0])]
-            for type in types:
-                if not configure.has_option(section, str(type)):
-                    bb.warn("Invalid dump type id =%s" % (str(type)))
-                    continue
-                typestr = configure.get(section, str(type))
-                destdir = os.path.join(dreport_dir, ("pl_" + typestr + ".d"))
-                if not os.path.exists(destdir):
-                    os.makedirs(destdir)
-                linkname = "E" + priority + script
-                destlink = os.path.join(destdir, linkname)
-                os.symlink(srclink, destlink)
+        install_dreport_user_script(srcname, d)
 }
 
 #Enable ubifs-workaround by DISTRO_FEATURE obmc-ubi-fs.
