Skip to content

Commit

Permalink
Adjusted the integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgetwan committed Oct 23, 2023
1 parent 6f7f665 commit 0cdf518
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion plugins/lookup/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run(self, terms, variables, **kwargs):
secret = self.get_option("automation_secret")
validate_certs = self.get_option("validate_certs")

site_url = server_url + '/' + site
site_url = server_url + "/" + site

api = CheckMKLookupAPI(
site_url=site_url,
Expand Down
2 changes: 1 addition & 1 deletion plugins/lookup/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def run(self, terms, variables, **kwargs):
secret = self.get_option("automation_secret")
validate_certs = self.get_option("validate_certs")

site_url = server_url + '/' + site
site_url = server_url + "/" + site

api = CheckMKLookupAPI(
site_url=site_url,
Expand Down
2 changes: 1 addition & 1 deletion plugins/lookup/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def run(self, terms, variables, **kwargs):
secret = self.get_option("automation_secret")
validate_certs = self.get_option("validate_certs")

site_url = server_url + '/' + site
site_url = server_url + "/" + site

api = CheckMKLookupAPI(
site_url=site_url,
Expand Down
2 changes: 1 addition & 1 deletion plugins/lookup/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run(self, terms, variables, **kwargs):
secret = self.get_option("automation_secret")
validate_certs = self.get_option("validate_certs")

site_url = server_url + '/' + site
site_url = server_url + "/" + site

api = CheckMKLookupAPI(
site_url=site_url,
Expand Down
9 changes: 6 additions & 3 deletions tests/integration/targets/lookup_folder/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
vars:
folders: "{{ lookup('checkmk.general.folders',
'/',
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand All @@ -33,7 +34,8 @@
vars:
extensions: "{{ lookup('checkmk.general.folder',
checkmk_folder.path,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand All @@ -47,7 +49,8 @@
vars:
extensions: "{{ lookup('checkmk.general.folder',
checkmk_folder.path,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand Down
9 changes: 6 additions & 3 deletions tests/integration/targets/lookup_folders/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
folders: "{{ lookup('checkmk.general.folders',
'/',
recursive=True,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand All @@ -35,7 +36,8 @@
loop: "{{ lookup('checkmk.general.folders',
'/',
recursive=True,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand All @@ -53,7 +55,8 @@
folders: "{{ lookup('checkmk.general.folders',
'/',
recursive=True,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/targets/lookup_host/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
vars:
extensions: "{{ lookup('checkmk.general.host',
checkmk_host.name,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand All @@ -35,7 +36,8 @@
vars:
extensions: "{{ lookup('checkmk.general.host',
checkmk_host.name,
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/targets/lookup_hosts/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
ansible.builtin.debug:
msg: "Alias of {{ item.id }} is {{ item.extensions.attributes.alias }}"
loop: "{{ lookup('checkmk.general.hosts',
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand All @@ -35,7 +36,8 @@
that: "checkmk_hosts|length == hosts|length"
vars:
hosts: "{{ lookup('checkmk.general.hosts',
site_url=server_url + '/' + outer_item.site,
server_url=server_url,
site=outer_item.site,
validate_certs=False,
automation_user=automation_user,
automation_secret=automation_secret)
Expand Down

0 comments on commit 0cdf518

Please sign in to comment.