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

@@ -5,7 +5,6 @@
import copy
import json
import logging
import operator
import re
import urllib.parse
from collections import OrderedDict
@@ -45,7 +44,6 @@ from awx.main.constants import (
ANSI_SGR_PATTERN,
ACTIVE_STATES,
CENSOR_VALUE,
CHOICES_PRIVILEGE_ESCALATION_METHODS,
)
from awx.main.models import * # noqa
from awx.main.models.base import NEW_JOB_TYPE_CHOICES
@@ -2498,9 +2496,6 @@ class CredentialTypeSerializer(BaseSerializer):
field['label'] = _(field['label'])
if 'help_text' in field:
field['help_text'] = _(field['help_text'])
if field['type'] == 'become_method':
field.pop('type')
field['choices'] = list(map(operator.itemgetter(0), CHOICES_PRIVILEGE_ESCALATION_METHODS))
return value
def filter_field_metadata(self, fields, method):