[Pki-devel] [PATCH] 273/274 Add FeatureClient and FeatureCLI

Ade Lee alee at redhat.com
Fri Oct 2 17:13:27 UTC 2015


made changes suggested.  Pushed to master.

On Thu, 2015-10-01 at 11:56 -0500, Endi Sukma Dewata wrote:
> On 10/1/2015 11:17 AM, Ade Lee wrote:
> > Added feature client and CLI.  Also fixed a compilation error in
> > eclipse due to recent subCA changes to the caMap representation.
> > 
> > Please review,
> > Ade
> 
> Some comments:
> 
> 1. The code in FeatureShowCLI could be simplified as follows:
> 
>    if (cmdArgs.length > 1) {
>        System.err.println("Error: too many arguments.");
>        printHelp();
>        System.exit(-1);
>    }
> 
>    if (cmdArgs.length == 0) {
>       System.err.println("Error: No ID specified.");
>        printHelp();
>        System.exit(-1);
>    }
> 
>    String featureID = cmdArgs[0];
> 
> 2. In FeatureService the following code:
> 
>    feature.setEnabled(props.getOrDefault("enabled", 
> "false").equalsIgnoreCase("true"));
>    feature.setDescription(props.getOrDefault("description", ""));
>    feature.setVersion(props.getOrDefault("version", ""));
> 
> can be simplified into:
> 
>    feature.setEnabled(Boolean.parseBoolean(props.get("enabled")));
>    feature.setDescription(props.get("description"));
>    feature.setVersion(props.get("version"));
> 
> I think we should return a null if the field doesn't have a value. 
> The 
> XML/JSON output will be simpler. The CLI is already checking for 
> null.
> 
> ACK with the above changes.
> 




More information about the Pki-devel mailing list