ffdc: Add base infrastructure to support redfish protocol.

- Set 1: Initial commit for review. Add -t BMC_GET for redfish.
- Set 2: Add new CLI option --remote_protocol (-rp).
Default: ALL available.
- Set 3: Enhance messaging for Refish path.

Test:
- All types to OpenBMC's, RHEL, Ubuntu and AIX.
- Regression test to OpenBMC's, RHEL, Ubuntu and AIX.

Signed-off-by: Peter D  Phan <peterp@us.ibm.com>
Change-Id: I969a923b49cc38314cdc194a9e6de8acc3f89fdb
diff --git a/ffdc/collect_ffdc.py b/ffdc/collect_ffdc.py
index 0163512..48a849e 100644
--- a/ffdc/collect_ffdc.py
+++ b/ffdc/collect_ffdc.py
@@ -33,8 +33,13 @@
 @click.option('-l', '--location', default="/tmp",
               show_default=True, help="Location to store collected FFDC data")
 @click.option('-t', '--remote_type', default="OPENBMC",
-              show_default=True, help="OS type of the remote (targeting) host. OPENBMC, RHEL, UBUNTU, AIX")
-def cli_ffdc(remote, username, password, ffdc_config, location, remote_type):
+              show_default=True,
+              help="OS type of the remote (targeting) host. OPENBMC, RHEL, UBUNTU, AIX")
+@click.option('-rp', '--remote_protocol', default="ALL",
+              show_default=True,
+              help="Select protocol (SSH, SCP, REDFISH) to communicate with remote host. \
+                    Default: all available.")
+def cli_ffdc(remote, username, password, ffdc_config, location, remote_type, remote_protocol):
     r"""
     Stand alone CLI to generate and collect FFDC from the selected target.
     """
@@ -42,13 +47,14 @@
     click.echo("\n********** FFDC (First Failure Data Collection) Starts **********")
 
     if input_options_ok(remote, username, password, ffdc_config):
-        thisFFDC = FFDCCollector(remote, username, password, ffdc_config, location, remote_type)
+        thisFFDC = FFDCCollector(remote, username, password,
+                                 ffdc_config, location, remote_type, remote_protocol)
         thisFFDC.collect_ffdc()
 
         if len(os.listdir(thisFFDC.ffdc_dir_path)) == 0:
             click.echo("\n\tFFDC Collection from " + remote + " has failed.\n\n")
         else:
-            click.echo(str("\t" + str(len(os.listdir(thisFFDC.ffdc_dir_path)))
+            click.echo(str("\n\t" + str(len(os.listdir(thisFFDC.ffdc_dir_path)))
                        + " files were retrieved from " + remote))
             click.echo("\tFiles are stored in " + thisFFDC.ffdc_dir_path + "\n\n")