

def _host_power_action(self, req, host_name, action):
    'Reboots, shuts down or powers up the host.'
    context = req.environ['nova.context']
    authorize(context)
    try:
        result = self.api.host_power_action(context, host_name=host_name, action=action)
    except NotImplementedError:
        common.raise_feature_not_supported()
    except exception.HostNotFound as e:
        raise webob.exc.HTTPNotFound(explanation=host_name.format_message())
    except exception.ComputeServiceUnavailable as e:
        raise webob.exc.HTTPBadRequest(explanation=e.format_message())
    return {
        'host': host_name,
        'power_action': result,
    }

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/hosts.py HostController._host_power_action/VarMisuse@86/136 `e`->`host_name`