mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge pull request #1499 from mabashian/1458-vault-pass-prompt
Fixed bug where vault password prompt was not being hidden after removing default cred
This commit is contained in:
commit
b14a7eda35
@ -53,7 +53,7 @@ function atLaunchTemplateCtrl (
|
||||
launchConf: launchData.data,
|
||||
launchOptions: launchOptions.data
|
||||
}),
|
||||
triggerModalOpen: true,
|
||||
triggerModalOpen: true
|
||||
};
|
||||
|
||||
if (launchData.data.survey_enabled) {
|
||||
|
||||
@ -82,17 +82,25 @@ export default [ 'Rest', 'GetBasePath', 'ProcessErrors', 'CredentialTypeModel',
|
||||
vm.promptDataClone.prompts.credentials.passwords.ssh_key_unlock = {};
|
||||
}
|
||||
if(passwordNeeded.startsWith("vault_password")) {
|
||||
let vault_id;
|
||||
if(passwordNeeded.includes('.')) {
|
||||
let vault_id = null;
|
||||
if (passwordNeeded.includes('.')) {
|
||||
vault_id = passwordNeeded.split(/\.(.+)/)[1];
|
||||
}
|
||||
|
||||
if(!vm.promptDataClone.prompts.credentials.passwords.vault) {
|
||||
if (!vm.promptDataClone.prompts.credentials.passwords.vault) {
|
||||
vm.promptDataClone.prompts.credentials.passwords.vault = [];
|
||||
}
|
||||
|
||||
vm.promptDataClone.prompts.credentials.passwords.vault.push({
|
||||
vault_id: vault_id
|
||||
// Loop across the default credentials to find the name of the
|
||||
// credential that requires a password
|
||||
vm.promptDataClone.prompts.credentials.value.forEach((defaultCredential) => {
|
||||
if (defaultCredential.vault_id === vault_id) {
|
||||
vm.promptDataClone.prompts.credentials.passwords.vault.push({
|
||||
id: defaultCredential.id,
|
||||
name: defaultCredential.name,
|
||||
vault_id: defaultCredential.vault_id
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user