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 Feb 7, 2024
1 parent f72cd73 commit ddf8396
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,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 ddf8396

Please sign in to comment.