[api] begin to move to configparser
This commit is contained in:
		
					parent
					
						
							
								6d0ce65f5c
							
						
					
				
			
			
				commit
				
					
						a4bedb01f6
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -3,7 +3,7 @@ import os
 | 
			
		|||
 | 
			
		||||
from uuid import uuid4
 | 
			
		||||
 | 
			
		||||
from ucloud.config import etcd_client, env_vars
 | 
			
		||||
from ucloud.config import etcd_client, config
 | 
			
		||||
 | 
			
		||||
data = {
 | 
			
		||||
    "is_public": True,
 | 
			
		||||
| 
						 | 
				
			
			@ -13,4 +13,4 @@ data = {
 | 
			
		|||
    "attributes": {"list": [], "key": [], "pool": "images"},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
etcd_client.put(os.path.join(env_vars.get('IMAGE_STORE_PREFIX'), uuid4().hex), json.dumps(data))
 | 
			
		||||
etcd_client.put(os.path.join(config['api']['IMAGE_STORE_PREFIX'], uuid4().hex), json.dumps(data))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue