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

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/4420/head
Abhijeet Kasurde 2017-06-07 11:53:29 +05:30 committed by René Moser
parent 26349033c1
commit 8a4a04b016
1 changed files with 2 additions and 4 deletions

View File

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