ffdc: Integrate ffdc script into robot framework flow.

This commit provides interface to enable automation tests (robot/jenkins)
to activate the new cli ffdc collector.

- Patchset 1: Initial commit for review.
- Patchset 2: Redesing and fixing issues
- Patchset 3: Fix build issue (pycodestyle)
- Patchset 4: Default ffdc store location running direct CLI
- Patchset 5: Addressing review comments and questions
- Patchset 6: Restore direct CLI default location to /tmp
- Patchset 7: Addressing issues from comments
              Also extend socket timeout for long-running command peltool -a
- Patchset 8: Use Builtin().log_to_console("") method in the bridge code
- Patchset 9: Rebase

Tests:
- Standalone script: python3 ./ffdc/collect_ffdc.py
- Within robot env: python3 -m robot .... -v FFDC_DEFAULT:0 ./tools/myffdc.robot

Signed-off-by: Peter D  Phan <peterp@us.ibm.com>
Change-Id: Ic892c48efe7dbdb3a4345ba89c3a0257f03a7ffb
diff --git a/ffdc/collect_ffdc.py b/ffdc/collect_ffdc.py
index 7711fd6..c1c9495 100644
--- a/ffdc/collect_ffdc.py
+++ b/ffdc/collect_ffdc.py
@@ -18,7 +18,7 @@
     for found_dir in dirs:
         sys.path.append(os.path.join(root, found_dir))
 
-from ffdc_collector import FFDCCollector
+from ffdc_collector import ffdc_collector
 
 
 @click.command(context_settings=dict(help_option_names=['-h', '--help']))
@@ -61,26 +61,26 @@
     click.echo("\n********** FFDC (First Failure Data Collection) Starts **********")
 
     if input_options_ok(remote, username, password, config, type):
-        thisFFDC = FFDCCollector(remote,
-                                 username,
-                                 password,
-                                 config,
-                                 location,
-                                 type,
-                                 protocol,
-                                 env_vars,
-                                 econfig,
-                                 log_level)
-        thisFFDC.collect_ffdc()
+        this_ffdc = ffdc_collector(remote,
+                                   username,
+                                   password,
+                                   config,
+                                   location,
+                                   type,
+                                   protocol,
+                                   env_vars,
+                                   econfig,
+                                   log_level)
+        this_ffdc.collect_ffdc()
 
-        if len(os.listdir(thisFFDC.ffdc_dir_path)) == 0:
+        if len(os.listdir(this_ffdc.ffdc_dir_path)) == 0:
             click.echo("\n\tFFDC Collection from " + remote + " has failed.\n\n")
         else:
-            click.echo(str("\n\t" + str(len(os.listdir(thisFFDC.ffdc_dir_path)))
+            click.echo(str("\n\t" + str(len(os.listdir(this_ffdc.ffdc_dir_path)))
                            + " files were retrieved from " + remote))
-            click.echo("\tFiles are stored in " + thisFFDC.ffdc_dir_path)
+            click.echo("\tFiles are stored in " + this_ffdc.ffdc_dir_path)
 
-        click.echo("\tTotal elapsed time " + thisFFDC.elapsed_time + "\n\n")
+        click.echo("\tTotal elapsed time " + this_ffdc.elapsed_time + "\n\n")
     click.echo("\n********** FFDC Finishes **********\n\n")