From 38d1cce5d1e2cee5f91bae537fdbc237867bb26d Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 5 Aug 2016 11:28:02 -0700 Subject: [PATCH] Use open_url directly to avoid failing tests. (#2680) --- lib/ansible/modules/extras/monitoring/logicmonitor.py | 5 ++--- lib/ansible/modules/extras/monitoring/logicmonitor_facts.py | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/extras/monitoring/logicmonitor.py b/lib/ansible/modules/extras/monitoring/logicmonitor.py index be01632735..8d35f3bfbb 100644 --- a/lib/ansible/modules/extras/monitoring/logicmonitor.py +++ b/lib/ansible/modules/extras/monitoring/logicmonitor.py @@ -550,7 +550,6 @@ class LogicMonitor(object): self.password = params["password"] self.fqdn = socket.getfqdn() self.lm_url = "logicmonitor.com/santaba" - self.urlopen = open_url # use the ansible provided open_url self.__version__ = self.__version__ + "-ansible-module" def rpc(self, action, params): @@ -577,7 +576,7 @@ class LogicMonitor(object): headers = {"X-LM-User-Agent": self.__version__} # Set headers - f = self.urlopen(url, headers=headers) + f = open_url(url, headers=headers) raw = f.read() resp = json.loads(raw) @@ -608,7 +607,7 @@ class LogicMonitor(object): self.module.debug("Attempting to open URL: " + "https://" + self.company + "." + self.lm_url + "/do/" + action + "?" + param_str) - f = self.urlopen( + f = open_url( "https://" + self.company + "." + self.lm_url + "/do/" + action + "?" + param_str) return f.read() diff --git a/lib/ansible/modules/extras/monitoring/logicmonitor_facts.py b/lib/ansible/modules/extras/monitoring/logicmonitor_facts.py index 7e9bf00cb5..cc91ca6122 100644 --- a/lib/ansible/modules/extras/monitoring/logicmonitor_facts.py +++ b/lib/ansible/modules/extras/monitoring/logicmonitor_facts.py @@ -200,7 +200,6 @@ class LogicMonitor(object): self.password = params["password"] self.fqdn = socket.getfqdn() self.lm_url = "logicmonitor.com/santaba" - self.urlopen = open_url # use the ansible provided open_url self.__version__ = self.__version__ + "-ansible-module" def rpc(self, action, params): @@ -227,7 +226,7 @@ class LogicMonitor(object): headers = {"X-LM-User-Agent": self.__version__} # Set headers - f = self.urlopen(url, headers=headers) + f = open_url(url, headers=headers) raw = f.read() resp = json.loads(raw)