Update python code for python 3.8 or higher compatibility

Changes:
     - Update shebang directive to use python3 explicitly.
     - remove preexec_fn feature which is deprecated in higher
       python version 3.8 and above.
     - bufsize fix, from documentation bufsize 1 means line buffered
      (only usable if universal_newlines=True i.e., in a text mode)
      refer: https://docs.python.org/3/library/subprocess.html
     - Fix SyntaxWarning: "is" with "=="

Change-Id: Ib96c1ba8c2327d6774d0d731b48ca7e61a4a297a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/bin/auto_status_file.py b/bin/auto_status_file.py
index 1a372f7..d1614f3 100755
--- a/bin/auto_status_file.py
+++ b/bin/auto_status_file.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 See help text for details.
diff --git a/bin/event_notification_util.py b/bin/event_notification_util.py
index 66cf970..380a120 100755
--- a/bin/event_notification_util.py
+++ b/bin/event_notification_util.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 See help text for details.
diff --git a/bin/generate_inventory b/bin/generate_inventory
index 77c8f70..b56d22e 100755
--- a/bin/generate_inventory
+++ b/bin/generate_inventory
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 r"""
 Generate an inventory variable file containing a list of properties
 fields from the YAML phosphor-dbus-interfaces repository.
diff --git a/bin/generate_testsuite_info.py b/bin/generate_testsuite_info.py
index ffd713e..7cafd1e 100755
--- a/bin/generate_testsuite_info.py
+++ b/bin/generate_testsuite_info.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 Use robot framework API to extract test data from test suites.
diff --git a/bin/obmc_ser_num b/bin/obmc_ser_num
index 6d2efeb..96fa7e0 100755
--- a/bin/obmc_ser_num
+++ b/bin/obmc_ser_num
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 This program will get the system serial number from an OBMC machine and print it to stdout.
diff --git a/bin/plug_ins/Auto_reboot/cp_master b/bin/plug_ins/Auto_reboot/cp_master
index 1a885b5..8dd9e0e 100755
--- a/bin/plug_ins/Auto_reboot/cp_master
+++ b/bin/plug_ins/Auto_reboot/cp_master
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 Set the auto_boot policy according to the caller's wishes.
diff --git a/bin/plug_ins/FFDC/cp_ffdc_check b/bin/plug_ins/FFDC/cp_ffdc_check
index 97a3f44..8d51271 100755
--- a/bin/plug_ins/FFDC/cp_ffdc_check
+++ b/bin/plug_ins/FFDC/cp_ffdc_check
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from gen_print import *
 from gen_valid import *
diff --git a/bin/plug_ins/Soft_errors/cp_post_boot b/bin/plug_ins/Soft_errors/cp_post_boot
index f49cd26..4eb951c 100755
--- a/bin/plug_ins/Soft_errors/cp_post_boot
+++ b/bin/plug_ins/Soft_errors/cp_post_boot
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from gen_print import *
 from gen_valid import *
diff --git a/bin/plug_ins/Stop/cp_stop_check b/bin/plug_ins/Stop/cp_stop_check
index fd63304..e3ef1cb 100755
--- a/bin/plug_ins/Stop/cp_stop_check
+++ b/bin/plug_ins/Stop/cp_stop_check
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 Check for stop conditions.  Return code of 2 if stop conditions are found.
diff --git a/bin/print_ffdc_functions b/bin/print_ffdc_functions
index 016c119..7d56584 100755
--- a/bin/print_ffdc_functions
+++ b/bin/print_ffdc_functions
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 See help text for details.
diff --git a/bin/process_plug_in_packages.py b/bin/process_plug_in_packages.py
index a9d1bcf..bd389c8 100755
--- a/bin/process_plug_in_packages.py
+++ b/bin/process_plug_in_packages.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 See help text for details.
diff --git a/bin/prop_call.py b/bin/prop_call.py
index eab1c77..15cff57 100755
--- a/bin/prop_call.py
+++ b/bin/prop_call.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 See help text for details (--help or -h option)..
diff --git a/bin/validate_plug_ins.py b/bin/validate_plug_ins.py
index 13ec687..a202d2e 100755
--- a/bin/validate_plug_ins.py
+++ b/bin/validate_plug_ins.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import sys
 try:
diff --git a/bin/websocket_monitor.py b/bin/websocket_monitor.py
index f1de2c6..846ccd5 100755
--- a/bin/websocket_monitor.py
+++ b/bin/websocket_monitor.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 See help text for details.