From 2f031f13fc5548a055ab1c01346a77a60b675d53 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Sun, 23 Aug 2015 00:04:51 +0200 Subject: [PATCH] cloudstack: cs_portforward: fix returns for int casting * missing self. * variable must be named portforwarding_rule, not resource --- .../modules/extras/cloud/cloudstack/cs_portforward.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_portforward.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_portforward.py index 502f6ce1f6..034290b044 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_portforward.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_portforward.py @@ -361,9 +361,9 @@ class AnsibleCloudStackPortforwarding(AnsibleCloudStack): super(AnsibleCloudStackPortforwarding, self).get_result(portforwarding_rule) if portforwarding_rule: # Bad bad API does not always return int when it should. - for search_key, return_key in returns_to_int.iteritems(): - if search_key in resource: - self.result[return_key] = int(resource[search_key]) + for search_key, return_key in self.returns_to_int.iteritems(): + if search_key in portforwarding_rule: + self.result[return_key] = int(portforwarding_rule[search_key]) return self.result