jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-labs] CloudSigma2 ComputeService and SecurityGroupExtension (#70)
Date Sun, 21 Sep 2014 15:05:10 GMT
> +      if (options.getRunScript() != null) {
> +         builder.add(options.getRunScript());
> +      }
> +      if (options.getPrivateKey() != null) {
> +         builder.add(new InstallRSAPrivateKey(options.getPrivateKey()));
> +      }
> +
> +      ImmutableList<Statement> bootstrap = builder.build();
> +      if (!bootstrap.isEmpty()) {
> +         if (options.getTaskName() == null && !(options.getRunScript() instanceof
InitScript)) {
> +            options.nameTask("bootstrap");
> +         }
> +         return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap);
> +      }
> +
> +      return null;

Just as a personal style preference, handle the "exceptional case" first? I.e.
```
if (bootstrap.isEmpty()) {
   return null;
}
...
```
?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/70/files#r17825999
Mime
View raw message