From 12a4c9c500695e160b4543f6c93a87c333f0a8ae Mon Sep 17 00:00:00 2001 From: zsdc Date: Wed, 16 Sep 2020 19:35:38 +0300 Subject: cc_vyos: T2117: OVF datasource cleanup The `DataSourceOVF.py` file was cleaned up from VyOS-specific changes. Also was changed related functionality in the `cc_vyos.py`: - in addition to limited metadata provided by Cloud-init, the function `get_properties` from the `DataSourceOVF.py` used to get unfiltered values from an OVF environment; - `set_tag` for the `interfaces ethernet` node was moved from multiple places to the `set_ipaddress` function; - multiple checks for 'null' value in OVF were replaced with the iteration via all values and replacing `null` with `None`. This allows using easier logic during values check; - simplified conversion of the values from OVF to an IP address; - added logging for all actions in the `set_config_ovf` function. --- cloudinit/sources/DataSourceOVF.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cloudinit/sources/DataSourceOVF.py') diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index 6a9a331d..e53d2eb1 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -436,8 +436,7 @@ def read_ovf_environment(contents): cfg = {} ud = None cfg_props = ['password'] - md_props = ['seedfrom', 'local-hostname', 'public-keys', 'instance-id', - 'ip0', 'netmask0', 'gateway', 'DNS', 'NTP', 'APIKEY' ,'APIPORT', 'APIDEBUG'] + md_props = ['seedfrom', 'local-hostname', 'public-keys', 'instance-id'] for (prop, val) in props.items(): if prop == 'hostname': prop = "local-hostname" -- cgit v1.2.3