add cloud_environments
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
		
			
				
	
				gl/check check status: pending (04bf5aaa52cf68129fdc97d4ae6e6d673978366a)
				
			
		
		
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	gl/check check status: pending (04bf5aaa52cf68129fdc97d4ae6e6d673978366a)
				
			This commit is contained in:
		
							
								
								
									
										2
									
								
								otc_metadata/data/cloud_environments/eu_de.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								otc_metadata/data/cloud_environments/eu_de.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
---
 | 
			
		||||
name: eu_de
 | 
			
		||||
							
								
								
									
										2
									
								
								otc_metadata/data/cloud_environments/swiss.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								otc_metadata/data/cloud_environments/swiss.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
---
 | 
			
		||||
name: swiss
 | 
			
		||||
@ -17,6 +17,7 @@
 | 
			
		||||
# documents/services/service_categories is being merged with
 | 
			
		||||
# the content here.
 | 
			
		||||
---
 | 
			
		||||
cloud_environments: []
 | 
			
		||||
documents: []
 | 
			
		||||
service_categories: []
 | 
			
		||||
services: []
 | 
			
		||||
 | 
			
		||||
@ -37,7 +37,7 @@ class Services(object):
 | 
			
		||||
        sorted_docs = []
 | 
			
		||||
        for doc in self._service_data["documents"]:
 | 
			
		||||
            sorted_docs.append(dict(sorted(doc.items(), key=lambda kv: kv[0])))
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        # sort docs list by <service_type>_<title>
 | 
			
		||||
        self._service_data["documents"] = sorted(
 | 
			
		||||
            sorted_docs,
 | 
			
		||||
@ -62,10 +62,20 @@ class Services(object):
 | 
			
		||||
        if other in self._service_data["service_categories"]:
 | 
			
		||||
            self._service_data["service_categories"].remove(other)
 | 
			
		||||
            self._service_data["service_categories"].append(other)
 | 
			
		||||
        # sort cloud environments by <name>
 | 
			
		||||
        self._service_data["cloud_environments"] = sorted(
 | 
			
		||||
            self._service_data["cloud_environments"],
 | 
			
		||||
            key=lambda x: f"{x.get('name')}",
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def _rewrite_data(self):
 | 
			
		||||
        otc_metadata.data.rewrite_data("services.yaml", self._service_data)
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def all_cloud_environments(self):
 | 
			
		||||
        "Service Categories data listing."
 | 
			
		||||
        return copy.deepcopy(self._service_data["cloud_environments"])
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def all_services(self):
 | 
			
		||||
        "Service Categories data listing."
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user