#NEWLINE# def _host_power_action( self , req , host , action ) : #NEWLINE# #INDENT# 'Reboots, shuts down or powers up the host.' #NEWLINE# context = req . environ [ 'nova.context' ] #NEWLINE# try : #NEWLINE# #INDENT# result = self . compute_api . host_power_action ( context , host = host , action = action ) #NEWLINE# #UNINDENT# except NotImplementedError as e : #NEWLINE# #INDENT# raise webob . exc . HTTPBadRequest ( explanation = e . msg ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'host' : host , #NEWLINE# 'power_action' : result , #NEWLINE# #UNINDENT# }