Project

General

Profile

Bug #22280

ceph-volume - ceph.conf parsing error, due to whitespace

Added by Alwin Antreich over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
Start date:
11/30/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

If the ceph.conf has leading whitespace ceph-volume fails with a parsing error. But works if you remove the whitespace.

root@sumi2:~# ceph-volume lvm create --bluestore --data /dev/sdf
--> Unable to read configuration file: /etc/ceph/ceph.conf
--> File contains parsing errors: /etc/ceph/ceph.conf
    [line  2]: '        auth client required = cephx\n'
    [line  3]: '        auth cluster required = cephx\n'
    [line  4]: '        auth service required = cephx\n'
    [line  5]: '        cluster network = 10.10.10.0/24\n'
    [line  6]: '        fsid = 5a03e18d-d99d-4686-878c-f48dcdab3270\n'
    [line  7]: '        keyring = /etc/pve/priv/$cluster.$name.keyring\n'
    [line  8]: '        mon allow pool delete = true\n'
    [line  9]: '        osd journal size = 5120\n'
    [line 10]: '        osd pool default min size = 2\n'
    [line 11]: '        osd pool default size = 3\n'
    [line 12]: '        public network = 10.10.10.0/24\n'
    [line 15]: '        keyring = /var/lib/ceph/osd/ceph-$id/keyring\n'
    [line 18]: '        host = sumi3\n'
    [line 19]: '        mon addr = 10.10.10.36:6789\n'
    [line 22]: '        host = sumi1\n'
    [line 23]: '        mon addr = 10.10.10.34:6789\n'
    [line 26]: '        host = sumi2\n'
    [line 27]: '        mon addr = 10.10.10.35:6789\n'
No handlers could be found for logger "ceph_volume.configuration" 
--> Unable to read configuration file: /etc/ceph/ceph.conf
--> File contains parsing errors: /etc/ceph/ceph.conf
    [line  2]: '        auth client required = cephx\n'
    [line  3]: '        auth cluster required = cephx\n'
    [line  4]: '        auth service required = cephx\n'
    [line  5]: '        cluster network = 10.10.10.0/24\n'
    [line  6]: '        fsid = 5a03e18d-d99d-4686-878c-f48dcdab3270\n'
    [line  7]: '        keyring = /etc/pve/priv/$cluster.$name.keyring\n'
    [line  8]: '        mon allow pool delete = true\n'
    [line  9]: '        osd journal size = 5120\n'
    [line 10]: '        osd pool default min size = 2\n'
    [line 11]: '        osd pool default size = 3\n'
    [line 12]: '        public network = 10.10.10.0/24\n'
    [line 15]: '        keyring = /var/lib/ceph/osd/ceph-$id/keyring\n'
    [line 18]: '        host = sumi3\n'
    [line 19]: '        mon addr = 10.10.10.36:6789\n'
    [line 22]: '        host = sumi1\n'
    [line 23]: '        mon addr = 10.10.10.34:6789\n'
    [line 26]: '        host = sumi2\n'
    [line 27]: '        mon addr = 10.10.10.35:6789\n'
-->  AttributeError: 'NoneType' object has no attribute 'get'

AFAICT, the class _TrimIndentFile is nowhere called in the ceph-volume package.

ceph_volume/configuration.py
class _TrimIndentFile(object):

History

#1 Updated by Alfredo Deza over 1 year ago

  • Assignee set to Alfredo Deza
  • Priority changed from Normal to High

#2 Updated by Alfredo Deza over 1 year ago

Do you know what version of Python are you using to trigger this? I was only able to replicate with 2.6 which is deprecated already. Also, what distro/version would help

#3 Updated by Alwin Antreich over 1 year ago

Alfredo Deza wrote:

Do you know what version of Python are you using to trigger this? I was only able to replicate with 2.6 which is deprecated already. Also, what distro/version would help

root@sumi1:~# python -V
Python 2.7.13

root@sumi1:~# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)" 

root@sumi1:~# cat /etc/debian_version 
9.1

#4 Updated by Alfredo Deza over 1 year ago

  • Status changed from New to Need Review

#5 Updated by Alwin Antreich over 1 year ago

Did a test of the PR on my ceph cluster, it worked with a ceph.conf that has different levels of whitespace.

#6 Updated by Brad Hubbard over 1 year ago

  • Category set to 135

#7 Updated by Alfredo Deza over 1 year ago

  • Status changed from Need Review to Resolved

merged commit b7a9c44 into master

Also available in: Atom PDF