Zap disks if reformatting is requested

This commit is contained in:
James Page 2013-06-24 14:52:52 +01:00
parent ebc4f8e729
commit b0bf0e6632
1 changed files with 6 additions and 1 deletions

View File

@ -108,6 +108,7 @@ def is_osd_disk(dev):
for line in info:
if line.startswith(
'Partition GUID code: 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D'
'Partition GUID code: 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D'
):
return True
except subprocess.CalledProcessError:
@ -317,7 +318,11 @@ def osdize(dev, osd_format, osd_journal, reformat_osd=False):
# Just provide the device - no other options
# for older versions of ceph
cmd.append(dev)
subprocess.call(cmd)
if reformat_osd:
zap_disk(dev)
subprocess.check_call(cmd)
def device_mounted(dev):