diff --git a/pyang/plugins/sid.py b/pyang/plugins/sid.py index 97265662..fdf39fa2 100644 --- a/pyang/plugins/sid.py +++ b/pyang/plugins/sid.py @@ -761,10 +761,8 @@ def generate_file(self): for item in self.content['items']: del item['status'] - if os.path.exists(self.output_file_name): - os.remove(self.output_file_name) - with open(self.output_file_name, 'w') as outfile: + outfile.truncate(0) json.dump(self.content, outfile, indent=2) ########################################################