jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svet <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] Generate Azure VM password on the fly (#402)
Date Wed, 12 Jul 2017 11:52:51 GMT
neykov 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()) {

Didn't like it initially because it will generate a password regardless of whether used. But
+1 for cleaner code. Updated.

-- 
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_r126933224
Mime
View raw message