vcenter provider: avoid a TypeError exception

Avoid `TypeError: option values must be strings` with `ConfigParser`.
Default values must be string, not `None`.

The error happens when `test/integration/cloud-config-vcenter.ini` does
not have the `vmware_proxy_host` or `vmware_proxy_port` keys defined.
This commit is contained in:
Gonéri Le Bouder 2019-07-12 11:05:27 +02:00
parent b7868529ee
commit e9b1e36d76

View file

@ -215,8 +215,8 @@ class VcenterProvider(CloudProvider):
def _setup_static(self):
parser = ConfigParser({
'vcenter_port': '443',
'vmware_proxy_host': None,
'vmware_proxy_port': None})
'vmware_proxy_host': '',
'vmware_proxy_port': ''})
parser.read(self.config_static_path)
self.endpoint = parser.get('DEFAULT', 'vcenter_hostname')