<s> from kamaki . cli . config import Config <EOL> from kamaki . clients import astakos , image , ClientError <EOL> from kamaki . clients . utils import https <EOL> https . patch_with_certs ( '<STR_LIT>' ) <EOL> cnf = Config ( ) <EOL> CLOUD = cnf . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> URL = cnf . get_cloud ( CLOUD , '<STR_LIT:url>' ) <EOL> TOKEN = cnf . get_cloud ( CLOUD , '<STR_LIT>' ) <EOL> identity_client = astakos . CachedAstakosClient ( URL , TOKEN ) <EOL> imageURL = identity_client . get_endpoint_url ( image . ImageClient . service_type ) <EOL> image_client = image . ImageClient ( imageURL , TOKEN ) <EOL> location = ( identity_client . user_info ( ) [ '<STR_LIT:id>' ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> properties = dict ( osfamily = '<STR_LIT>' , users = '<STR_LIT:root>' , os = '<STR_LIT>' ) <EOL> img = image_client . register ( '<STR_LIT>' , location , properties = properties ) <EOL> image_client . unregister ( img [ '<STR_LIT:id>' ] ) </s>
