diff --git a/blazar/plugins/oshosts/host_plugin.py b/blazar/plugins/oshosts/host_plugin.py index c98d7a59..d6a75e3b 100644 --- a/blazar/plugins/oshosts/host_plugin.py +++ b/blazar/plugins/oshosts/host_plugin.py @@ -660,7 +660,11 @@ def allocation_candidates(self, values): return host_ids def _is_admin(self): - ctx = context.current() + try: + # when monitor calls this will raise an error + ctx = context.current() + except RuntimeError: + return False if policy.enforce(ctx, 'admin', {}, do_raise=False): return True else: