summaryrefslogtreecommitdiffstats
path: root/awxkit
diff options
context:
space:
mode:
Diffstat (limited to 'awxkit')
-rw-r--r--awxkit/awxkit/api/pages/execution_environments.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/awxkit/awxkit/api/pages/execution_environments.py b/awxkit/awxkit/api/pages/execution_environments.py
index c3bcecb4bf..a01aa91011 100644
--- a/awxkit/awxkit/api/pages/execution_environments.py
+++ b/awxkit/awxkit/api/pages/execution_environments.py
@@ -20,21 +20,22 @@ class ExecutionEnvironment(HasCreate, base.Base):
dependencies = [Organization, Credential]
NATURAL_KEY = ('name',)
- # fields are image, organization, managed_by_tower, credential
- def create(self, image='quay.io/ansible/ansible-runner:devel', credential=None, **kwargs):
+ # fields are name, image, organization, managed_by_tower, credential
+ def create(self, name='', image='quay.io/ansible/ansible-runner:devel', credential=None, **kwargs):
# we do not want to make a credential by default
- payload = self.create_payload(image=image, credential=credential, **kwargs)
+ payload = self.create_payload(name=name, image=image, credential=credential, **kwargs)
ret = self.update_identity(ExecutionEnvironments(self.connection).post(payload))
return ret
- def create_payload(self, organization=Organization, **kwargs):
+ def create_payload(self, name='', organization=Organization, **kwargs):
self.create_and_update_dependencies(organization)
- payload = self.payload(organization=self.ds.organization, **kwargs)
+ payload = self.payload(name=name, organization=self.ds.organization, **kwargs)
payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
return payload
- def payload(self, image=None, organization=None, credential=None, **kwargs):
+ def payload(self, name='', image=None, organization=None, credential=None, **kwargs):
payload = PseudoNamespace(
+ name=name or "EE - {}".format(random_title()),
image=image or random_title(10),
organization=organization.id if organization else None,
credential=credential.id if credential else None,