Add supported distro in YAML config for FFDC

Changes:
      - Added the list of support OSes in YAML file.
      - Add code in init class to load YAML data.

User can define their own YAML or modify to support non listed
distro or OEM names to target remote system for data collection.

Change-Id: Ic896dc778e12c1669304360479a7b948d08fb43e
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/ffdc/ffdc_collector.py b/ffdc/ffdc_collector.py
index 8b242ab..2316df2 100644
--- a/ffdc/ffdc_collector.py
+++ b/ffdc/ffdc_collector.py
@@ -58,6 +58,13 @@
         else:
             sys.exit(-1)
 
+        # Load default or user define YAML configuration file.
+        with open(self.ffdc_config, 'r') as file:
+            self.ffdc_actions = yaml.load(file, Loader=yaml.FullLoader)
+
+        # List of supported OSes.
+        self.supported_oses = self.ffdc_actions['DISTRO_OS'][0]
+
     def verify_script_env(self):
 
         # Import to log version
@@ -105,6 +112,8 @@
         Inspect remote host os-release or uname.
 
         """
+        print("\n\tSupported distro: %s" % self.supported_oses)
+
         command = "cat /etc/os-release"
         response = self.remoteclient.execute_command(command)
         if response:
@@ -128,7 +137,7 @@
 
             user_target_type = self.target_type
             self.target_type = ""
-            for each_os in FFDCCollector.supported_oses:
+            for each_os in self.supported_oses:
                 if each_os in identity:
                     self.target_type = each_os
                     break
@@ -231,8 +240,6 @@
 
         print("\n\t---- Executing commands on " + self.hostname + " ----")
         print("\n\tWorking protocol list: %s" % working_protocol_list)
-        with open(self.ffdc_config, 'r') as file:
-            ffdc_actions = yaml.load(file, Loader=yaml.FullLoader)
 
         # Set prefix values for scp files and directory.
         # Since the time stamp is at second granularity, these values are set here
@@ -240,6 +247,7 @@
         # and they will be saved in the same directory.
         # self.location == local system for now
         self.set_ffdc_defaults()
+        ffdc_actions = self.ffdc_actions
 
         for machine_type in ffdc_actions.keys():
             if self.target_type != machine_type:
diff --git a/ffdc/ffdc_config.yaml b/ffdc/ffdc_config.yaml
index cf895b7..04b577b 100644
--- a/ffdc/ffdc_config.yaml
+++ b/ffdc/ffdc_config.yaml
@@ -13,6 +13,10 @@
 # Note: When a new remote type is added to this configuration file,
 #       it is also need to be added the list of supported OSes in ffdc_collector.py
 
+# User can add the distro or system type name in the list generic/OEM for log collection.
+DISTRO_OS:
+    - ['OPENBMC', 'RHEL', 'AIX', 'UBUNTU']
+
 # Commands and Files to collect for a given OpenBMC system.
 OPENBMC:
     # Commands and File to take snapshot of linux based system.