dreport: Fix warnings displayed during plugin execution

Tested:
Tue Apr 26 07:20:23 UTC 2022 INFO: Collected proc fd
Tue Apr 26 07:20:18 UTC 2022 INFO: Collected Attribute list
Tue Apr 26 07:20:18 UTC 2022 INFO: Copied Device tree file
/var/lib/phosphor-software-manager/hostfw/running/DEVTREE
Tue Apr 26 07:20:18 UTC 2022 INFO: Copied Attribute info db
/usr/share/pdata/attributes_info.db

Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Change-Id: I34e454552b5f903721acf6149a4abee6b3f53bb7
diff --git a/tools/dreport.d/openpower.d/plugins.d/phal_devtree b/tools/dreport.d/openpower.d/plugins.d/phal_devtree
index 990e0ef..bf768ee 100644
--- a/tools/dreport.d/openpower.d/plugins.d/phal_devtree
+++ b/tools/dreport.d/openpower.d/plugins.d/phal_devtree
@@ -7,29 +7,34 @@
 # shellcheck disable=SC1091
 . "$DREPORT_INCLUDE"/functions
 
-attributes="/usr/bin/attributes"
-attr_list_file_name="PHAL_devtree.txt"
+# shellcheck source=./power-target.sh
+source /etc/profile.d/power-target.sh
 
 #export attributes list to attribute_list.txt
+attributes="/usr/bin/attributes"
+file_name="PHAL_devtree.txt"
+attr_cmd="$attributes export"
+desc="Attribute list"
 if [ -x $attributes ]; then
-    add_cmd_output "$attributes export" "$attr_list_file_name" "Attribute list"
+    add_cmd_output "$attr_cmd" "$file_name" "$desc"
 fi
-
 #copy PHAL device tree file to dump
-devtree_file_name="/var/lib/phosphor-software-manager/hostfw/running/DEVTREE"
-if [ -f "$devtree_file_name" ]; then
-    add_copy_file "$devtree_file_name" "device tree"
+file_name="$PDBG_DTB"
+desc="Device tree file"
+if [ -e "$file_name" ]; then
+    add_copy_file "$file_name" "$desc"
 fi
 
-
 #copy PHAL export device tree to dump
-exp_dev_tree="/var/lib/phal/exportdevtree"
-if [ -f "$exp_dev_tree" ]; then
-    add_copy_file "$exp_dev_tree" "export device tree"
+file_name="/var/lib/phal/exportdevtree"
+desc="Exported device tree file"
+if [ -e "$file_name" ]; then
+    add_copy_file "$file_name" "$desc"
 fi
 
 #copy attribues info db to dump
-attr_info_db="/usr/share/pdata/attributes_info.db"
-if [ -f "$attr_info_db" ]; then
-    add_copy_file "$attr_info_db" "attribute info db"
+file_name="$PDATA_INFODB"
+desc="Attribute info db"
+if [ -e "$file_name" ]; then
+    add_copy_file "$file_name" "$desc"
 fi
diff --git a/tools/dreport.d/plugins.d/procfd b/tools/dreport.d/plugins.d/procfd
index f1a1ce5..d6a07af 100644
--- a/tools/dreport.d/plugins.d/procfd
+++ b/tools/dreport.d/plugins.d/procfd
@@ -4,7 +4,10 @@
 # @brief: List the open file descriptors
 #
 
-. $DREPORT_INCLUDE/functions
+# shellcheck disable=SC1091
+. "$DREPORT_INCLUDE"/functions
 
 file_name="procfd.log"
-add_cmd_output "ls -Al /proc/*/fd/" "$file_name" "procfd"
+desc="proc fd"
+cmd="ls -Al /proc/*/fd/ 2> /dev/null"
+add_cmd_output "$cmd" "$file_name" "$desc"