Project

General

Profile

Bug #12385

hosts.remotes.set_repo_priority() can write invalid repo lines

Added by Travis Rhoden about 6 years ago. Updated almost 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

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:

riority=1
priority=1

On a third install:

iority=1
priority=1

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"

History

#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.

Also available in: Atom PDF