public static <T, E extends Exception> T runInContext(OpsContext opsContext, CheckedCallable<T, E> callable)
throws OpsException {
Scope scope = Scope.inherit();
scope.put(opsContext);
try {
scope.push();
return callable.call();
} catch (Exception e) {
log.warn("Error running operation", e);
if (e instanceof OpsException) {
throw ((OpsException) e);