mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Violette Roche-Montane
02.46.2013 dd511c6c8d6917d250f92464b070764899d253d2
Fixed issue reported in OpenAm case with embedded server ( the upgrade fails due to the inexistence of the config/upgrade folder (see : 'Archiving concatenated schema' task))
Added more verbose logs.
1 files modified
29 ■■■■■ changed files
opends/src/server/org/opends/server/tools/upgrade/UpgradeUtils.java 29 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/upgrade/UpgradeUtils.java
@@ -429,6 +429,9 @@
      {
        LinkedList<String> dataRelativesToBck = new LinkedList<String>();
        entry = entryReader.readEntry();
        // Backend dn
        dataRelativesToBck.add(entry.getAttribute("ds-cfg-base-dn")
            .firstValueAsString());
        // db path
        dataRelativesToBck.add(entry.getAttribute("ds-cfg-db-directory")
            .firstValueAsString());
@@ -742,11 +745,33 @@
        final File destination =
            new File(configDirectory, Installation.UPGRADE_PATH
                + File.separator + "schema.ldif." + revision);
        // Checks if the parent exists (eg. embedded
        // server doesn't seem to provide that folder)
        if (!destination.getParentFile().exists())
        {
          LOG.log(Level.INFO, String.format("File %s's parent doesn't exist",
              destination.getPath()));
          destination.getParentFile().mkdirs();
          LOG.log(Level.INFO, String.format("Parent directory created.",
              destination.getPath()));
        }
        if (!destination.exists())
        {
          destination.createNewFile();
        }
        LOG.log(Level.INFO, String.format("Writing entries in %s.", destination
            .getAbsolutePath()));
        writer = new LDIFEntryWriter(new FileOutputStream(destination));
        writer.writeEntry(theNewSchemaEntry);
        LOG.log(Level.INFO, String.format("%s file created successfully.",
            destination.getAbsolutePath()));
        LOG.log(Level.INFO, String.format(
            "%s file created and completed successfully.", destination
                .getAbsolutePath()));
      }
    }
    finally