jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] Generate Azure VM password on the fly (#402)
Date Wed, 12 Jul 2017 11:56:30 GMT
nacx commented on this pull request.



> @@ -130,6 +136,20 @@ protected CreateResourcesThenCreateNodes(
       return super.execute(group, count, template, goodNodes, badNodes, customizationResponses);
    }
 
+   // Azure requires that we pass it the VM password. Need to generate one if not overriden
by the user.
+   private void generatePasswordIfNoneProvided(Template template) {
+      TemplateOptions options = template.getOptions();
+      if (options.getLoginPassword() == null) {
+         Optional<String> passwordOptional = template.getImage().getDefaultCredentials().getOptionalPassword();
+         if (passwordOptional.isPresent()) {

It's only a syntactic sugar. You have also the supplier option, but it is not that readable
then. I'm OK with keeping unchanged :) Feel free to merge your preferred version.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/402#discussion_r126933825
Mime
View raw message