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

copilot-swe-agent[bot]
17 hours ago f78db2be93603c5950652d2577f54ab102bef32e
Fix status CLI to accept --hostname, --port, and --trustAll arguments

Agent-Logs-Url: https://github.com/OpenIdentityPlatform/OpenDJ/sessions/25c854fc-0b86-4ae7-9d95-6d433894aa8c

Co-authored-by: vharseko <6818498+vharseko@users.noreply.github.com>
2 files modified
10 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java 2 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java
@@ -246,14 +246,20 @@
      // LDAPConnectionConsoleInteraction, this done, it will not prompt
      // the user for them.
      controlInfo.setConnectionPolicy(ConnectionProtocolPolicy.USE_ADMIN);
      int port = controlInfo.getAdminConnectorHostPort().getPort();
      final SecureConnectionCliArgs secureArgsList = argParser.getSecureArgsList();
      final StringArgument hostNameArg = secureArgsList.getHostNameArg();
      if (!hostNameArg.isPresent())
      {
      hostNameArg.setPresent(true);
      hostNameArg.addValue(hostNameArg.getDefaultValue());
      }
      final IntegerArgument portArg = secureArgsList.getPortArg();
      if (!portArg.isPresent())
      {
        int port = controlInfo.getAdminConnectorHostPort().getPort();
      portArg.setPresent(true);
      portArg.addValue(Integer.toString(port));
      }
      // We already know if SSL or StartTLS can be used.  If we cannot
      // use them we will not propose them in the connection parameters
      // and if none of them can be used we will just not ask for the
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCliArgumentParser.java
@@ -78,8 +78,6 @@
  throws ArgumentException
  {
    ArrayList<Argument> defaultArgs = new ArrayList<>(createGlobalArguments(outStream, alwaysSSL));
    defaultArgs.remove(secureArgsList.getPortArg());
    defaultArgs.remove(secureArgsList.getHostNameArg());
    defaultArgs.remove(verboseArg);
    defaultArgs.remove(noPropertiesFileArg);
    defaultArgs.remove(propertiesFileArg);