Skip to content

Commit

Permalink
MID-8842 ninja - misc fixes around distribution upgrade objects
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Jul 31, 2023
1 parent 4a00595 commit 540a86e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ public boolean isApplicable(PrismObject<?> object, ItemPath path) {
public boolean process(PrismObject<ObjectType> object, ItemPath path) {
return false;
}

@Override
public String upgradeDescription(PrismObject<ObjectType> object, ItemPath path) {
return "Matching of personas by subtype values is not supported anymore. Any such use should be migrated to the use of archetypes.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void processObject(RepositoryService repository, T object) throws Except

OperationResult opResult = new OperationResult("Modify object");
try {
ObjectDelta<?> delta = cloned.diff(prismObject);
ObjectDelta<?> delta = prismObject.diff(cloned);
Collection<? extends ItemDelta<?, ?>> modifications = delta.getModifications();
RepoModifyOptions opts = modifications.isEmpty() ? RepoModifyOptions.createForceReindex() : new RepoModifyOptions();

Expand All @@ -90,9 +90,11 @@ private void processObject(RepositoryService repository, T object) throws Except
} finally {
opResult.computeStatusIfUnknown();

log.error(
"Modification of '{} ({})' didn't finished with success\n{}",
object.getName(), object.getOid(), opResult.shortDump());
if (!opResult.isSuccess()) {
log.error(
"Modification of '{} ({})' didn't finished with success\n{}",
object.getName(), object.getOid(), opResult.debugDumpLazily());
}
}
}
}

0 comments on commit 540a86e

Please sign in to comment.