private static ModelNode executeOperation(final ModelControllerClient client, final Operation op, boolean unwrapResult) throws IOException, MgmtOperationException {
ModelNode ret = client.execute(op);
if (!unwrapResult) return ret;
if (!SUCCESS.equals(ret.get(OUTCOME).asString())) {
throw new MgmtOperationException("Management operation failed: " + ret.get(FAILURE_DESCRIPTION), op.getOperation(), ret);
}
return ret.get(RESULT);
}