Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions systemvm/debian/opt/cloud/bin/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ def __createfile(self, ip, folder, file, data):
if os.path.exists(metamanifest):
fh = open(metamanifest, "a+")
self.__exflock(fh)
fh.seek(0)
Comment on lines 909 to +911
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GutoVeronezi , I think your intention is

Suggested change
fh = open(metamanifest, "a+")
self.__exflock(fh)
fh.seek(0)
fh = open(metamanifest, “w+")
self.__exflock(fh)

opeing with a+ will not truncate the previous version, but only overwrite data afaik.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a is for appending; + is for allow reading, however, the pointer must be set to 0 to the validation work properly. w would overwrite the data. This is the same as #10254

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, I missed the fh.read() on the next line

if file not in fh.read():
fh.write(file + '\n')
self.__unflock(fh)
Expand Down
Loading