Skip to content

Commit 0f315aa

Browse files
authored
Merge pull request #51 from T-Systems-MMS/improve_coverage
improve coverage of new service module
2 parents 6d503cf + 77b6bed commit 0f315aa

9 files changed

Lines changed: 10 additions & 28 deletions

File tree

examples/icinga_service_apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
url_password: "{{ icinga_pass }}"
88
object_name: "SERVICE_dummy"
99
assign_filter: 'host.name="foohost"'
10-
check_command: "hostalive"
10+
check_command: hostalive
1111
display_name: "dummy process"
1212
imports:
1313
- fooservicetemplate

plugins/modules/icinga_service.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,9 @@ def main():
372372
"volatile": module.params["volatile"],
373373
}
374374

375-
try:
376-
icinga_object = IcingaServiceObject(
377-
module=module, path="/service", data=data
378-
)
379-
except Exception as e:
380-
module.fail_json(
381-
msg="unable to connect to Icinga. Exception message: %s" % e
382-
)
375+
icinga_object = IcingaServiceObject(
376+
module=module, path="/service", data=data
377+
)
383378

384379
changed, diff = icinga_object.update(module.params["state"])
385380
module.exit_json(

plugins/modules/icinga_service_apply.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
url_password: "{{ icinga_pass }}"
161161
object_name: "SERVICE_dummy"
162162
assign_filter: 'host.name="foohost"'
163+
check_command: hostalive
163164
display_name: "dummy process"
164165
imports:
165166
- fooservicetemplate

tests/integration/targets/icinga/roles/icinga/tasks/absent_icinga_service_apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
url_password: "{{ icinga_pass }}"
88
object_name: "SERVICE_dummy"
99
assign_filter: 'host.name="foohost"'
10-
check_command: "hostalive"
10+
check_command: hostalive
1111
display_name: "dummy process"
1212
groups:
1313
- fooservicegroup

tests/integration/targets/icinga/roles/icinga/tasks/icinga_service_apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
url_password: "{{ icinga_pass }}"
88
object_name: "SERVICE_dummy"
99
assign_filter: 'host.name="foohost"'
10-
check_command: "hostalive"
10+
check_command: hostalive
1111
display_name: "dummy process"
1212
imports:
1313
- fooservicetemplate

tests/integration/targets/icinga/roles/icinga/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
- wrong_pass_icinga_host.yml
8989
- wrong_pass_icinga_service.yml
9090

91+
- absent_icinga_service.yml
9192
- absent_icinga_host.yml
9293
- absent_icinga_host_template.yml
9394
- absent_icinga_hostgroup.yml
@@ -104,7 +105,6 @@
104105
- absent_icinga_timeperiod.yml
105106
- absent_icinga_command.yml
106107
- absent_icinga_command_template.yml
107-
- absent_icinga_service.yml
108108

109109
- name: deploy changes in icinga
110110
tags: uri

tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
url_password: "{{ icinga_pass }}"
88
object_name: "SERVICE_dummy"
99
assign_filter: 'host.name="foohost"'
10-
check_command: "hostalive"
10+
check_command: hostalive
1111
display_name: "dummy process"
1212
imports:
1313
- fooservicetemplate

tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
url_password: iamwrong
88
object_name: "SERVICE_dummy"
99
assign_filter: 'host.name="foohost"'
10-
check_command: "hostalive"
10+
check_command: hostalive
1111
display_name: "dummy process"
1212
imports:
1313
- fooservicetemplate

tests/integration/targets/icinga/tasks/icinga_service.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)