diff options
author | Jeff Bradberry <jeff.bradberry@gmail.com> | 2020-12-08 15:42:02 +0100 |
---|---|---|
committer | Shane McDonald <me@shanemcd.com> | 2021-03-04 00:52:54 +0100 |
commit | e7bf81883be4d1eb16d4becdb172a5aa546a6c8c (patch) | |
tree | 97eecc92c32f1441981f59085be70debf0766483 /awxkit | |
parent | Move the resolve_execution_environment method to the mixin class (diff) | |
download | awx-e7bf81883be4d1eb16d4becdb172a5aa546a6c8c.tar.xz awx-e7bf81883be4d1eb16d4becdb172a5aa546a6c8c.zip |
Populate the EE name field in awxkit
Diffstat (limited to 'awxkit')
-rw-r--r-- | awxkit/awxkit/api/pages/execution_environments.py | 13 |
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, |