Browse Source

Merge pull request #882 from kwoodson/itservice

Fixed a bug.  Upon creation also add dependencies to slas.
Kenny Woodson 9 years ago
parent
commit
1d3e6f7053
1 changed files with 2 additions and 1 deletions
  1. 2 1
      roles/lib_zabbix/library/zbx_itservice.py

+ 2 - 1
roles/lib_zabbix/library/zbx_itservice.py

@@ -183,7 +183,7 @@ def main():
         if not exists(content):
             module.exit_json(changed=False, state="absent")
 
-        content = zapi.get_content(zbx_class_name, 'delete', [content['result'][0]['itemid']])
+        content = zapi.get_content(zbx_class_name, 'delete', [content['result'][0]['serviceid']])
         module.exit_json(changed=True, results=content['result'], state="absent")
 
     # Create and Update
@@ -210,6 +210,7 @@ def main():
             if content.has_key('error'):
                 module.exit_json(failed=True, changed=True, results=content['error'], state="present")
 
+            if dependencies:
                 content = add_dependencies(zapi, module.params['name'], dependencies)
 
                 if content.has_key('error'):