<s> from kamaki . cli . config import Config <EOL> from kamaki . clients import astakos , cyclades , 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> computeURL = identity_client . get_endpoint_url ( <EOL> cyclades . CycladesComputeClient . service_type ) <EOL> compute_client = cyclades . CycladesComputeClient ( computeURL , TOKEN ) <EOL> srv = dict ( id = <NUM_LIT> ) <EOL> def assert_status ( new , expected ) : <EOL> assert new is not None , '<STR_LIT>' % expected <EOL> assert new == expected , '<STR_LIT>' % expected <EOL> srv [ '<STR_LIT:status>' ] = compute_client . get_server_details ( srv [ '<STR_LIT:id>' ] ) [ '<STR_LIT:status>' ] <EOL> compute_client . shutdown_server ( srv [ '<STR_LIT:id>' ] ) <EOL> print '<STR_LIT>' <EOL> srv [ '<STR_LIT:status>' ] = compute_client . wait_server ( srv [ '<STR_LIT:id>' ] , srv [ '<STR_LIT:status>' ] ) <EOL> assert_status ( srv [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> compute_client . start_server ( srv [ '<STR_LIT:id>' ] ) <EOL> print '<STR_LIT>' <EOL> srv [ '<STR_LIT:status>' ] = compute_client . wait_server ( srv [ '<STR_LIT:id>' ] , srv [ '<STR_LIT:status>' ] ) <EOL> assert_status ( srv [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> compute_client . reboot_server ( srv [ '<STR_LIT:id>' ] ) <EOL> print '<STR_LIT>' <EOL> srv [ '<STR_LIT:status>' ] = compute_client . wait_server ( srv [ '<STR_LIT:id>' ] , '<STR_LIT>' ) <EOL> assert_status ( srv [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> print '<STR_LIT>' <EOL> compute_client . delete_server ( srv [ '<STR_LIT:id>' ] ) <EOL> print '<STR_LIT>' <EOL> srv [ '<STR_LIT:status>' ] = compute_client . wait_server ( srv [ '<STR_LIT:id>' ] , srv [ '<STR_LIT:status>' ] ) <EOL> assert_status ( srv [ '<STR_LIT:status>' ] , '<STR_LIT>' ) <EOL> print '<STR_LIT>' </s>
