modules/mu/mommacat.rb in cloud-mu-3.4.0 vs modules/mu/mommacat.rb in cloud-mu-3.5.0

- old
+ new

@@ -171,10 +171,11 @@ @deployment['mu_public_ip'] = MU.mu_public_ip @private_key = nil @public_key = nil @secrets = Hash.new @secrets['instance_secret'] = Hash.new + @secrets['windows_admin_password'] = Hash.new @ssh_key_name = ssh_key_name @ssh_private_key = ssh_private_key @ssh_public_key = ssh_public_key @clouds = {} @seed = MU.seed # pass this in @@ -510,10 +511,12 @@ @ssh_public_key = File.read("#{ssh_dir}/#{@ssh_key_name}.pub") @ssh_public_key.chomp! @ssh_private_key = File.read("#{ssh_dir}/#{@ssh_key_name}") @ssh_private_key.chomp! +# XXX the following mess belongs in cloud layers, probably in their initDeploy +# methods if numKittens(clouds: ["AWS"], types: ["Server", "ServerPool", "ContainerCluster"]) > 0 creds_used = [] ["servers", "server_pools", "container_clusters"].each { |type| next if @original_config[type].nil? @original_config[type].each { |descriptor| @@ -549,11 +552,11 @@ def notify(type, key, data, mu_name: nil, remove: false, triggering_node: nil, delayed_save: false) no_write = (@no_artifacts or !caller.grep(/\/mommacat\.rb:\d+:in `notify'/).empty?) begin if !no_write - if !MU::MommaCat.lock("deployment-notification", deploy_id: @deploy_id, retries: 10) + if !MU::MommaCat.lock("deployment-notification", deploy_id: @deploy_id, retries: 300) raise MuError, "Failed to get deployment-notifcation lock for #{@deploy_id}" end end if !@need_deploy_flush or @deployment.nil? or @deployment.empty? @@ -882,16 +885,16 @@ end if resource and resource.config and resource.config['cloud'] cloudclass = MU::Cloud.cloudClass(resource.config['cloud']) - cloudclass.writeDeploySecret(@deploy_id, cert.to_pem, cert_cn+".crt", credentials: resource.config['credentials']) - cloudclass.writeDeploySecret(@deploy_id, key.to_pem, cert_cn+".key", credentials: resource.config['credentials']) + cloudclass.writeDeploySecret(self, cert.to_pem, cert_cn+".crt", credentials: resource.config['credentials']) + cloudclass.writeDeploySecret(self, key.to_pem, cert_cn+".key", credentials: resource.config['credentials']) if pfx_cert - cloudclass.writeDeploySecret(@deploy_id, pfx_cert.to_der, cert_cn+".pfx", credentials: resource.config['credentials']) + cloudclass.writeDeploySecret(self, pfx_cert.to_der, cert_cn+".pfx", credentials: resource.config['credentials']) end if winrm_cert - cloudclass.writeDeploySecret(@deploy_id, winrm_cert.to_pem, cert_cn+"-winrm.crt", credentials: resource.config['credentials']) + cloudclass.writeDeploySecret(self, winrm_cert.to_pem, cert_cn+"-winrm.crt", credentials: resource.config['credentials']) end end }