From daaca1abd5f01febeb8cb0063f477b311824dcd1 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 11 Dec 2018 17:45:25 -0500 Subject: [PATCH] fix vbox inventory to correclty unset pwfile (#49774) --- changelogs/fragments/vbox_fix.yml | 2 ++ lib/ansible/plugins/inventory/virtualbox.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/vbox_fix.yml diff --git a/changelogs/fragments/vbox_fix.yml b/changelogs/fragments/vbox_fix.yml new file mode 100644 index 00000000000..e968c883bd5 --- /dev/null +++ b/changelogs/fragments/vbox_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - preserve Noneness of pwdfile when it is None in virtualbox inventory plugin diff --git a/lib/ansible/plugins/inventory/virtualbox.py b/lib/ansible/plugins/inventory/virtualbox.py index e66f2807679..2e807da7346 100644 --- a/lib/ansible/plugins/inventory/virtualbox.py +++ b/lib/ansible/plugins/inventory/virtualbox.py @@ -237,7 +237,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): update_cache = True if not source_data: - b_pwfile = to_bytes(self.get_option('settings_password_file'), errors='surrogate_or_strict') + b_pwfile = to_bytes(self.get_option('settings_password_file'), errors='surrogate_or_strict', nonstring='passthru') running = self.get_option('running_only') # start getting data