Commit 4e1bb95f authored by Yingjie Xu's avatar Yingjie Xu

Do not overwrite state file if exists.

parent 7ada3c77
...@@ -76,9 +76,10 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe): ...@@ -76,9 +76,10 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe):
self.parameter_dict["software_list"]) self.parameter_dict["software_list"])
configuration.set("agent", "log_directory", self.options["log_directory"]) configuration.set("agent", "log_directory", self.options["log_directory"])
configuration.set("agent", "state_file", self.options["state_file"]) configuration.set("agent", "state_file", self.options["state_file"])
state = open(self.options["state_file"], "w") if not os.path.exists(self.options["state_file"]):
state.write('') state = open(self.options["state_file"], "w")
state.close() state.write('')
state.close()
configuration.set("agent", "path_file", self.options["path_file"]) configuration.set("agent", "path_file", self.options["path_file"])
configuration.add_section("software_uri") configuration.add_section("software_uri")
software_list = json.loads(self.parameter_dict["software_list"]) software_list = json.loads(self.parameter_dict["software_list"])
......
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