Skip to content

Commit d6178bb

Browse files
committed
fix(contrib/azure)-replace discovery url
1 parent e8ef0ee commit d6178bb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

contrib/azure/create-azure-user-data

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,19 @@ def main():
5656
azure_template = get_file("azure-user-data-template")
5757
coreos_template = get_file("../coreos/user-data.example")
5858

59-
configuration_coreos_template = yaml.safe_load(coreos_template)
59+
coreos_template_w_url = None
60+
with open(coreos_template.name, 'r') as file :
61+
coreos_template_w_url = file.read()
62+
63+
coreos_template_w_url = coreos_template_w_url.replace('#DISCOVERY_URL', url)
64+
65+
configuration_coreos_template = yaml.safe_load(coreos_template_w_url)
6066
configuration_azure_template = yaml.safe_load(azure_template)
6167

6268
configuration = combine_dicts(configuration_coreos_template,
6369
configuration_azure_template)
6470

6571
dump = yaml.dump(configuration, default_flow_style=False)
66-
dump = dump.replace('#DISCOVERY_URL', url)
6772

6873
with azure_user_data as outfile:
6974
try:

0 commit comments

Comments
 (0)