Correctly read use_private_network as boolean

This fixes the use of public IPs in the discovered hosts by
ensuring that the use_private_network check doesn't always evaluate
to False if the associated .ini file specifies this option.

(cherry picked from commit 39e86ae2bc)
This commit is contained in:
Daniel Yates 2016-10-22 17:23:03 +01:00 committed by Michael Scherer
parent e97a00de9e
commit 6c118252b6

View file

@ -260,7 +260,7 @@ or environment variables (DO_API_TOKEN)\n''')
# Private IP Address
if config.has_option('digital_ocean', 'use_private_network'):
self.use_private_network = config.get('digital_ocean', 'use_private_network')
self.use_private_network = config.getboolean('digital_ocean', 'use_private_network')
# Group variables
if config.has_option('digital_ocean', 'group_variables'):