Merge pull request #3093 from jbradberry/become_plugins

Support become plugins

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-02-01 17:48:09 +00:00
committed by GitHub
6 changed files with 30 additions and 35 deletions

View File

@@ -32,7 +32,6 @@ from awx.main.models.rbac import (
ROLE_SINGLETON_SYSTEM_AUDITOR,
)
from awx.main.utils import encrypt_field
from awx.main.constants import CHOICES_PRIVILEGE_ESCALATION_METHODS
from . import injectors as builtin_injectors
__all__ = ['Credential', 'CredentialType', 'V1Credential', 'build_safe_env']
@@ -163,7 +162,6 @@ class V1Credential(object):
max_length=32,
blank=True,
default='',
choices=CHOICES_PRIVILEGE_ESCALATION_METHODS,
help_text=_('Privilege escalation method.')
),
'become_username': models.CharField(
@@ -539,7 +537,7 @@ class CredentialType(CommonModelNameNotUnique):
if field['id'] == field_id:
if 'choices' in field:
return field['choices'][0]
return {'string': '', 'boolean': False, 'become_method': ''}[field['type']]
return {'string': '', 'boolean': False}[field['type']]
@classmethod
def default(cls, f):
@@ -736,7 +734,7 @@ def ssh(cls):
}, {
'id': 'become_method',
'label': ugettext_noop('Privilege Escalation Method'),
'type': 'become_method',
'type': 'string',
'help_text': ugettext_noop('Specify a method for "become" operations. This is '
'equivalent to specifying the --become-method '
'Ansible parameter.')