logicmonitor: remove closed statement, used for py2.4 compat (#25240)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-06-07 11:53:29 +05:30 committed by René Moser
parent 26349033c1
commit 8a4a04b016

View file

@ -909,15 +909,13 @@ class Collector(LogicMonitor):
self.module.run_command("mkdir " + self.installdir)
try:
f = open(installfilepath, "w")
installer = (self.do("logicmonitorsetup",
{"id": self.id,
"arch": arch}))
f.write(installer)
f.closed
with open(installfilepath, "w") as write_file:
write_file.write(installer)
except:
self.fail(msg="Unable to open installer file for writing")
f.closed
else:
self.module.debug("Collector installer already exists")
return installfilepath