Commit 7f64359e authored by Vincent Pelletier's avatar Vincent Pelletier

Use "with" keyword to open & close file.

parent 5db300f0
......@@ -84,7 +84,7 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
configuration.write(open(configuration_path, "w"))
agent_crond_path = os.path.join(crond, "agent")
agent_crond = open(agent_crond_path, "w")
with open(agent_crond_path, "w") as agent_crond:
agent_crond.write("*/5 * * * * %s -S %s --pidfile=%s %s\n" % (
self.options["python_binary"],
self.options["agent_binary"],
......@@ -101,7 +101,6 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
self.options["report_stop"],
configuration_path,
))
agent_crond.close()
return self.path_list + [configuration_path, key_filepath, cert_filepath, agent_crond_path]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment