summaryrefslogtreecommitdiffstats
path: root/awxkit
diff options
context:
space:
mode:
authorChristian M. Adams <rooftopcellist@gmail.com>2021-06-17 18:54:06 +0200
committerShane McDonald <me@shanemcd.com>2021-06-22 16:49:36 +0200
commit06b04007a033aa6462cd1836e02e75a78c4f08d0 (patch)
tree66ed476e65e3e4872d2dd33cbb496eac6d87aab4 /awxkit
parentRename the TOWER_ settings (diff)
downloadawx-06b04007a033aa6462cd1836e02e75a78c4f08d0.tar.xz
awx-06b04007a033aa6462cd1836e02e75a78c4f08d0.zip
Rename managed_by_tower to managed
Diffstat (limited to 'awxkit')
-rw-r--r--awxkit/awxkit/api/pages/api.py4
-rw-r--r--awxkit/awxkit/api/pages/credentials.py6
-rw-r--r--awxkit/awxkit/api/pages/execution_environments.py2
-rw-r--r--awxkit/test/test_credentials.py4
4 files changed, 8 insertions, 8 deletions
diff --git a/awxkit/awxkit/api/pages/api.py b/awxkit/awxkit/api/pages/api.py
index b802432200..1feadf444d 100644
--- a/awxkit/awxkit/api/pages/api.py
+++ b/awxkit/awxkit/api/pages/api.py
@@ -82,8 +82,8 @@ class ApiV2(base.Base):
def _export(self, _page, post_fields):
# Drop any (credential_type) assets that are being managed by the instance.
- if _page.json.get('managed_by_tower'):
- log.debug("%s is managed by Tower, skipping.", _page.endpoint)
+ if _page.json.get('managed'):
+ log.debug("%s is managed, skipping.", _page.endpoint)
return None
if post_fields is None: # Deprecated endpoint or insufficient permissions
log.error("Object export failed: %s", _page.endpoint)
diff --git a/awxkit/awxkit/api/pages/credentials.py b/awxkit/awxkit/api/pages/credentials.py
index 8b3647c04d..cd5861cc3e 100644
--- a/awxkit/awxkit/api/pages/credentials.py
+++ b/awxkit/awxkit/api/pages/credentials.py
@@ -102,7 +102,7 @@ config_kind_to_credential_type_name_map = {kind: name for name, kind in credenti
def kind_and_config_cred_from_credential_type(credential_type):
kind = ''
- if not credential_type.managed_by_tower:
+ if not credential_type.managed:
return kind, PseudoNamespace()
try:
if credential_type.kind == 'net':
@@ -144,7 +144,7 @@ class CredentialType(HasCreate, base.Base):
NATURAL_KEY = ('name', 'kind')
def silent_delete(self):
- if not self.managed_by_tower:
+ if not self.managed:
return super(CredentialType, self).silent_delete()
def payload(self, kind='cloud', **kwargs):
@@ -245,7 +245,7 @@ class Credential(HasCopy, HasCreate, base.Base):
inputs = config.credentials.cloud['openstack']
else:
credential_type_name = config_kind_to_credential_type_name_map[kind]
- credential_type = CredentialTypes(self.connection).get(managed_by_tower=True, name__icontains=credential_type_name).results.pop()
+ credential_type = CredentialTypes(self.connection).get(managed=True, name__icontains=credential_type_name).results.pop()
credential_type, organization, user, team = filter_by_class((credential_type, CredentialType), (organization, Organization), (user, User), (team, Team))
if not any((user, team, organization)):
diff --git a/awxkit/awxkit/api/pages/execution_environments.py b/awxkit/awxkit/api/pages/execution_environments.py
index 3f6641fba3..f761fb6fdd 100644
--- a/awxkit/awxkit/api/pages/execution_environments.py
+++ b/awxkit/awxkit/api/pages/execution_environments.py
@@ -20,7 +20,7 @@ class ExecutionEnvironment(HasCreate, HasCopy, base.Base):
dependencies = [Organization, Credential]
NATURAL_KEY = ('name',)
- # fields are name, image, organization, managed_by_tower, credential
+ # fields are name, image, organization, managed, credential
def create(self, name='', image='quay.io/ansible/ansible-runner:devel', organization=Organization, credential=None, pull='', **kwargs):
# we do not want to make a credential by default
payload = self.create_payload(name=name, image=image, organization=organization, credential=credential, pull=pull, **kwargs)
diff --git a/awxkit/test/test_credentials.py b/awxkit/test/test_credentials.py
index 6adc5e9332..f2eff6a505 100644
--- a/awxkit/test/test_credentials.py
+++ b/awxkit/test/test_credentials.py
@@ -16,10 +16,10 @@ def set_config_cred_to_desired(config, location):
class MockCredentialType(object):
- def __init__(self, name, kind, managed_by_tower=True):
+ def __init__(self, name, kind, managed=True):
self.name = name
self.kind = kind
- self.managed_by_tower = managed_by_tower
+ self.managed = managed
@pytest.mark.parametrize(