Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: gtema <artem.goncharov@gmail.com> Co-committed-by: gtema <artem.goncharov@gmail.com>
		
			
				
	
	
		
			42 lines
		
	
	
		
			899 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			899 B
		
	
	
	
		
			Python
		
	
	
	
	
	
# import copy
 | 
						|
 | 
						|
from pathlib import Path
 | 
						|
import yaml
 | 
						|
 | 
						|
import otc_metadata
 | 
						|
 | 
						|
data = otc_metadata.services.Services()
 | 
						|
 | 
						|
for item in data.all_docs:
 | 
						|
    with open(
 | 
						|
        Path(
 | 
						|
            otc_metadata.data.DATA_DIR,
 | 
						|
            "documents",
 | 
						|
            f"{item['service_type']}-{item['type']}.yaml",
 | 
						|
        ),
 | 
						|
        "w",
 | 
						|
    ) as fp:
 | 
						|
        yaml.dump(item, fp, explicit_start=True)
 | 
						|
 | 
						|
for item in data.all_services:
 | 
						|
    with open(
 | 
						|
        Path(
 | 
						|
            otc_metadata.data.DATA_DIR,
 | 
						|
            "services",
 | 
						|
            f"{item['service_type']}.yaml",
 | 
						|
        ),
 | 
						|
        "w",
 | 
						|
    ) as fp:
 | 
						|
        yaml.dump(item, fp, explicit_start=True)
 | 
						|
 | 
						|
for item in data.service_categories:
 | 
						|
    with open(
 | 
						|
        Path(
 | 
						|
            otc_metadata.data.DATA_DIR,
 | 
						|
            "service_categories",
 | 
						|
            f"{item['name']}.yaml",
 | 
						|
        ),
 | 
						|
        "w",
 | 
						|
    ) as fp:
 | 
						|
        yaml.dump(item, fp, explicit_start=True)
 |