Project

General

Profile

Actions

Bug #22297

closed

ceph-volume should handle inline comments in the ceph.conf file

Added by Brad Hubbard over 6 years ago. Updated over 6 years ago.

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

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Having an inline comment in the ceph.conf file read by ceph-volume can result in cascading failures such as follows.

# ceph-volume lvm prepare --bluestore  --data /dev/sdv
Running command: sudo vgcreate --force --yes
ceph-b2f1b9b9-eecc-4c17-8b92-cfa60b31c121 # use uuidgen to create an ID,
use this for all ceph nodes in your cluster /dev/sdv
 stderr: Name contains invalid character, valid set includes:
[a-zA-Z0-9.-_+].
  New volume group name "ceph-b2f1b9b9-eecc-4c17-8b92-cfa60b31c121 # use
uuidgen to create an ID, use this for all ceph nodes in your cluster" is
invalid.
  Run `vgcreate --help' for more information.
-->  RuntimeError: command returned non-zero exit status: 3

Perhaps the use of SafeConfigParser requires a value for inline_comment_prefixes?

Actions #1

Updated by Alfredo Deza over 6 years ago

  • Project changed from Ceph to ceph-volume
  • Category deleted (135)

We can parse the config file with inline comments, but that means the comment char will be used to be escaped and that will prevent users from
having that char in a value.

For example this (naive) example will never work:

[global]
    key = #

Will treat the value of key as ''

I think there is nothing in ceph that would define something like that, but this means any part in the line would be escaped.

Also, are we wanting to use '#' as comments or ';' as well like in traditional INI style?

Note that we currently do allow comments, just not on the same line as the key/value

Actions #2

Updated by Alfredo Deza over 6 years ago

  • Status changed from New to Fix Under Review
Actions #3

Updated by Alfredo Deza over 6 years ago

  • Status changed from Fix Under Review to Resolved

merged commit f3a59fb into master

Actions #4

Updated by Alfredo Deza over 6 years ago

pushed to mimic-dev1

Actions

Also available in: Atom PDF