hosts.remotes.set_repo_priority() can write invalid repo lines
Saw this while testing install/uninstall repeated for Fedora + DNF:
priority=1 gets written in the ceph-source section correct the first time around.
On a second install, it ends with:
On a third install:
so, for the last section in the file, it seems to chop off the first character of the last line every time, then append a new "priority=1"
#1 Updated by Travis Rhoden almost 6 years ago
- Status changed from New to Resolved
- Target version set to 1.5.27
After pulling my hair out for a bit, this happens to already be resolved by: https://github.com/ceph/ceph-deploy/commit/56880827e096232a574a34343f1eec1086658aed
Since write_file() switched to using lower level file APIs (os.fdopen and os.open) I suspect it is no longer true that opening a file with mode 'w' truncates the file, as that would require O_TRUNC.
I'm not going to dig into it farther, but it appears fixed since we rewrite the entire file each time now.