#NEWLINE# def take_action( self , parsed_args ) : #NEWLINE# #INDENT# compute_client = self . app . client_manager . compute #NEWLINE# image_client = self . app . client_manager . image #NEWLINE# server = utils . find_resource ( compute_client . servers , parsed_args . server ) #NEWLINE# if parsed_args . name : #NEWLINE# #INDENT# name = parsed_args . name #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = server . name #NEWLINE# #UNINDENT# image_id = compute_client . servers . create_image ( server , name ) #NEWLINE# if parsed_args . wait : #NEWLINE# #INDENT# if utils . wait_for_status ( image_client . images . get , image_id , callback = _show_progress ) : #NEWLINE# #INDENT# sys . stdout . write ( '\n' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . log . error ( _ ( 'Error creating snapshot of server: %s' ) , parsed_args . server ) #NEWLINE# sys . stdout . write ( _ ( '\nError creating server snapshot' ) ) #NEWLINE# raise SystemExit #NEWLINE# #UNINDENT# #UNINDENT# image = _prep_image_detail ( image_client , image_id ) #NEWLINE# return zip ( * sorted ( six . iteritems ( image ) ) )