Make ceph-osd use the charm-helpers "is_device_mounted" function instead of defining
its own.
This commit is contained in:
parent
39325f6ca9
commit
e7d18012a3
|
@ -23,6 +23,7 @@ from charmhelpers.core.hookenv import (
|
|||
from charmhelpers.contrib.storage.linux.utils import (
|
||||
zap_disk,
|
||||
is_block_device,
|
||||
is_device_mounted,
|
||||
)
|
||||
from utils import (
|
||||
get_unit_hostname,
|
||||
|
@ -340,7 +341,7 @@ def osdize_dev(dev, osd_format, osd_journal, reformat_osd=False):
|
|||
log('Looks like {} is already an OSD, skipping.'.format(dev))
|
||||
return
|
||||
|
||||
if device_mounted(dev):
|
||||
if is_device_mounted(dev):
|
||||
log('Looks like {} is in use, skipping.'.format(dev))
|
||||
return
|
||||
|
||||
|
@ -383,9 +384,5 @@ def osdize_dir(path):
|
|||
subprocess.check_call(cmd)
|
||||
|
||||
|
||||
def device_mounted(dev):
|
||||
return subprocess.call(['grep', '-wqs', dev + '1', '/proc/mounts']) == 0
|
||||
|
||||
|
||||
def filesystem_mounted(fs):
|
||||
return subprocess.call(['grep', '-wqs', fs, '/proc/mounts']) == 0
|
||||
|
|
Loading…
Reference in New Issue