diff --git a/cloudbaseinit/conf/nocloud.py b/cloudbaseinit/conf/nocloud.py index 8b0d2302..09e77438 100644 --- a/cloudbaseinit/conf/nocloud.py +++ b/cloudbaseinit/conf/nocloud.py @@ -34,6 +34,9 @@ def __init__(self, config): "userdata_file", default="user-data", help="The file name where the service looks for" "userdata"), + cfg.StrOpt("network_file", default="network-config", + help="The file name where the service looks for" + "network configuration"), ] def register(self): diff --git a/cloudbaseinit/metadata/services/nocloudservice.py b/cloudbaseinit/metadata/services/nocloudservice.py index 70190d01..cbcb8fdf 100644 --- a/cloudbaseinit/metadata/services/nocloudservice.py +++ b/cloudbaseinit/metadata/services/nocloudservice.py @@ -662,6 +662,7 @@ def __init__(self): 'cidata', CONF.nocloud.metadata_file, CONF.nocloud.userdata_file) self._meta_data = {} + self._network_file = CONF.nocloud.network_file def get_user_data(self): return self._get_cache_data(self._userdata_file) @@ -706,7 +707,7 @@ def get_network_details(self): def get_network_details_v2(self): try: - raw_network_data = self._get_cache_data("network-config", + raw_network_data = self._get_cache_data(self._network_file, decode=True) network_data = serialization.parse_json_yaml(raw_network_data) if not network_data: