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):
7272  elif  os .path .exists (f"{ checkpointPath3 }  /main.yml" ):
7373    print ("checkpoint path 3" )
7474    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 )
8575
8676
8777def  get_value_from_yml (yml_file_path , key ):
@@ -94,6 +84,11 @@ def get_value_from_yml(yml_file_path, key):
9484        else :
9585          print (f"The '{ key }  ' key was not found in the file: { yml_file_path }  ." )
9686          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+ 
9792    return  value 
9893
9994
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments