Prompt for credentials

fixed prompt for credentials so that ssh and ssh key unlock were both accounted for
This commit is contained in:
Jared Tabor
2014-12-18 10:52:53 -05:00
parent 9ce6101cd4
commit 50372f9c38

View File

@@ -757,9 +757,13 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
Rest.setUrl(GetBasePath('credentials')+credential); Rest.setUrl(GetBasePath('credentials')+credential);
Rest.get() Rest.get()
.success(function (data) { .success(function (data) {
if((data.kind === "ssh" && data.password === "ASK" ) || data.ssh_key_unlock === "ASK"){ if(data.kind === "ssh"){
if(data.password === "ASK" ){
passwords.push("ssh_password"); passwords.push("ssh_password");
} }
if(data.ssh_key_unlock === "ASK"){
passwords.push("ssh_key_unlock");
}
if(data.sudo_password === "ASK"){ if(data.sudo_password === "ASK"){
passwords.push("sudo_password"); passwords.push("sudo_password");
} }
@@ -780,6 +784,8 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
scope.$emit('PromptForSurvey', html, url); scope.$emit('PromptForSurvey', html, url);
} }
else scope.$emit('StartPlaybookRun', url); else scope.$emit('StartPlaybookRun', url);
}
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',