File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,6 @@ def merge_spray_components_version_files(merged_file_path):
72
72
elif os .path .exists (f"{ checkpointPath3 } /main.yml" ):
73
73
print ("checkpoint path 3" )
74
74
merge_dir_content_to_file ([checkpointPath3 , sprayDefaultPath ], merged_file_path )
75
-
76
- f = None
77
- with open (merged_file_path , "r" ) as file :
78
- f = yaml .safe_load (file )
79
- if re .match (r".*{{.*" , f .get ("kube_version" , "" )):
80
- f ["kube_version" ] = list (f ['kubelet_checksums' ]['amd64' ].keys ())[0 ]
81
-
82
- if f is not None :
83
- with open (merged_file_path , "w" ) as file :
84
- yaml .dump (f , file )
85
75
86
76
87
77
def get_value_from_yml (yml_file_path , key ):
@@ -94,6 +84,11 @@ def get_value_from_yml(yml_file_path, key):
94
84
else :
95
85
print (f"The '{ key } ' key was not found in the file: { yml_file_path } ." )
96
86
sys .exit (1 )
87
+
88
+ if isinstance (value , str ) and re .match (r".*{{.*" , value ):
89
+ checksumsKey = next ((key_item ["checksumsKey" ] for key_item in COMPONENTS_KEYS if key_item ["name" ] == keys [- 1 ].replace ("_version" , "" )), None )
90
+ value = list (get_value_from_yml (yml_file_path , checksumsKey ).keys ())[0 ]
91
+
97
92
return value
98
93
99
94
You can’t perform that action at this time.
0 commit comments