From c3e50db1d58e61e1b0cc00ec2df1cc6bf9710b63 Mon Sep 17 00:00:00 2001 From: junji hashimoto Date: Wed, 10 Apr 2019 22:52:26 +0900 Subject: [PATCH] Renamed SafeConfigParser to ConfigParser in gce inventory script (#54974) --- .../54974-rename-safeconfigparser-to-configparser.yaml | 2 ++ contrib/inventory/gce.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/54974-rename-safeconfigparser-to-configparser.yaml diff --git a/changelogs/fragments/54974-rename-safeconfigparser-to-configparser.yaml b/changelogs/fragments/54974-rename-safeconfigparser-to-configparser.yaml new file mode 100644 index 00000000000..76c0698b2ac --- /dev/null +++ b/changelogs/fragments/54974-rename-safeconfigparser-to-configparser.yaml @@ -0,0 +1,2 @@ +minor_changes: + - rename safeConfigParser to ConfigParser to suppress DeprecationWarning (The SafeConfigParser class has been renamed to ConfigParser in Python 3.2.) diff --git a/contrib/inventory/gce.py b/contrib/inventory/gce.py index 89a08fbd137..0a7df3f52a4 100755 --- a/contrib/inventory/gce.py +++ b/contrib/inventory/gce.py @@ -184,7 +184,7 @@ class GceInventory(object): """ Reads the settings from the gce.ini file. - Populates a SafeConfigParser object with defaults and + Populates a ConfigParser object with defaults and attempts to read an .ini-style configuration from the filename specified in GCE_INI_PATH. If the environment variable is not present, the filename defaults to gce.ini in the current @@ -198,7 +198,7 @@ class GceInventory(object): # This provides empty defaults to each key, so that environment # variable configuration (as opposed to INI configuration) is able # to work. - config = configparser.SafeConfigParser(defaults={ + config = configparser.ConfigParser(defaults={ 'gce_service_account_email_address': '', 'gce_service_account_pem_file_path': '', 'gce_project_id': '',