Skip to content

Commit

Permalink
linstor: failed remove of allow-two-primaries is no fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Dec 27, 2023
1 parent de9bc1d commit 2c939f1
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,21 @@ public boolean disconnectPhysicalDiskByPath(String localPath)
ApiCallRcList answers = api.resourceDefinitionModify(rsc.get().getName(), rdm);
if (answers.hasError())
{
s_logger.error("Failed to remove 'allow-two-primaries' on " + rsc.get().getName());
throw new CloudRuntimeException(answers.get(0).getMessage());
s_logger.error(
String.format("Failed to remove 'allow-two-primaries' on %s: %s",
rsc.get().getName(), LinstorUtil.getBestErrorMessage(answers)));
// do not fail here as removing allow-two-primaries property isn't fatal
}

return true;
}
s_logger.warn("Linstor: Couldn't find resource for this path: " + localPath);
} catch (ApiException apiEx) {
s_logger.error(apiEx);
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
s_logger.error(apiEx.getBestMessage());
// do not fail here as removing allow-two-primaries property isn't fatal
}
}
return false;
return true;
}

@Override
Expand Down

0 comments on commit 2c939f1

Please sign in to comment.