mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
ceph-daemon: configparser is ConfigParser on py2
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
beb09ff548
commit
97d9664927
@ -31,8 +31,15 @@ You can invoke ceph-daemon in two ways:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import configparser
|
try:
|
||||||
|
from configparser import ConfigParser # py3
|
||||||
|
except ImportError:
|
||||||
|
from ConfigParser import ConfigParser # py2
|
||||||
import fcntl
|
import fcntl
|
||||||
|
try:
|
||||||
|
from io import StringIO # py3
|
||||||
|
except:
|
||||||
|
from StringIO import StringIO # py2
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@ -45,14 +52,6 @@ import time
|
|||||||
import uuid
|
import uuid
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
|
|
||||||
try:
|
|
||||||
from StringIO import StringIO
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
from io import StringIO
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
podman_path = None
|
podman_path = None
|
||||||
|
|
||||||
@ -228,7 +227,7 @@ def check_unit(unit_name):
|
|||||||
|
|
||||||
def get_legacy_config_fsid(cluster):
|
def get_legacy_config_fsid(cluster):
|
||||||
try:
|
try:
|
||||||
config = configparser.ConfigParser()
|
config = ConfigParser()
|
||||||
config.read('/etc/ceph/%s.conf' % cluster)
|
config.read('/etc/ceph/%s.conf' % cluster)
|
||||||
if 'global' in config and 'fsid' in config['global']:
|
if 'global' in config and 'fsid' in config['global']:
|
||||||
return config['global']['fsid']
|
return config['global']['fsid']
|
||||||
@ -739,7 +738,7 @@ def command_bootstrap():
|
|||||||
logging.info('Cluster fsid: %s' % fsid)
|
logging.info('Cluster fsid: %s' % fsid)
|
||||||
|
|
||||||
# config
|
# config
|
||||||
cp = configparser.ConfigParser()
|
cp = ConfigParser()
|
||||||
if args.config:
|
if args.config:
|
||||||
cp.read(args.config)
|
cp.read(args.config)
|
||||||
if args.mon_ip:
|
if args.mon_ip:
|
||||||
|
Loading…
Reference in New Issue
Block a user