Skip to content
Permalink
Browse files
[JENKINS-47909] Prudent to add a log message when we are migrating a …
…user record for any reason.
  • Loading branch information
jglick committed Nov 9, 2017
1 parent e2d3682 commit 5d2b8248d361948de7a8ea9595521c9578f7fcad
Showing 1 changed file with 4 additions and 1 deletion.
@@ -453,7 +453,9 @@ public synchronized void doSubmitDescription( StaplerRequest req, StaplerRespons
if (o instanceof User) {
if (idStrategy().equals(id, legacyUserDir.getName()) && !idStrategy().filenameOf(legacyUserDir.getName())
.equals(legacyUserDir.getName())) {
if (!legacyUserDir.renameTo(configFile.getParentFile())) {
if (legacyUserDir.renameTo(configFile.getParentFile())) {
LOGGER.log(Level.INFO, "Migrated user record from {0} to {1}", new Object[] {legacyUserDir, configFile.getParentFile()});
} else {
LOGGER.log(Level.WARNING, "Failed to migrate user record from {0} to {1}",
new Object[]{legacyUserDir, configFile.getParentFile()});
}
@@ -478,6 +480,7 @@ public synchronized void doSubmitDescription( StaplerRequest req, StaplerRespons
try {
Files.createDirectory(configFile.getParentFile().toPath());
Files.move(unsanitizedLegacyConfigFile.toPath(), configFile.toPath());
LOGGER.log(Level.INFO, "Migrated unsafe user record from {0} to {1}", new Object[] {unsanitizedLegacyConfigFile, configFile});
} catch (IOException | InvalidPathException e) {
LOGGER.log(
Level.WARNING,

0 comments on commit 5d2b824

Please sign in to comment.