Revert "Automatically zap a disk if no valid gpt label is present"

This reverts commit 108f5500ad.

Change-Id: I75a7fc7ae63a4f7fc4db9292a1e7d1bb99df1a34
Related-Bug: #1664496
This commit is contained in:
Giulio Fidente 2017-02-16 11:15:15 +01:00 committed by Mykyta Karpin
parent f749fa16ce
commit 9f52c306e1
2 changed files with 0 additions and 82 deletions

View File

@ -73,10 +73,8 @@ define ceph::osd (
$ceph_check_udev = "ceph-osd-check-udev-${name}"
$ceph_prepare = "ceph-osd-prepare-${name}"
$ceph_activate = "ceph-osd-activate-${name}"
$ceph_zap_osd = "ceph-osd-zap-${name}"
Package<| tag == 'ceph' |> -> Exec[$ceph_check_udev]
Exec[$ceph_zap_osd] -> Exec[$ceph_check_udev]
Ceph_config<||> -> Exec[$ceph_prepare]
Ceph::Mon<||> -> Exec[$ceph_prepare]
Ceph::Key<||> -> Exec[$ceph_prepare]
@ -84,44 +82,6 @@ define ceph::osd (
# Ensure none is activated before prepare is finished for all
Exec<| tag == 'prepare' |> -> Exec<| tag == 'activate' |>
if $journal {
$ceph_zap_journal = "ceph-osd-zap-${name}-${journal}"
Exec[$ceph_zap_osd] -> Exec[$ceph_zap_journal]
Exec[$ceph_zap_journal] -> Exec[$ceph_check_udev]
exec { $ceph_zap_journal:
command => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
if [ -b ${journal} ]; then
ceph-disk zap ${journal}
fi
",
unless => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
! test -b ${journal} ||
test $(parted -ms ${journal} p 2>&1 | egrep -c 'Error.*unrecognised disk label') -eq 0
",
logoutput => true,
timeout => $exec_timeout,
}
}
exec { $ceph_zap_osd:
command => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
if [ -b ${data} ]; then
ceph-disk zap ${data}
fi
",
unless => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
! test -b ${data} ||
test $(parted -ms ${data} p 2>&1 | egrep -c 'Error.*unrecognised disk label') -eq 0
",
logoutput => true,
timeout => $exec_timeout,
}
$udev_rules_file = '/usr/lib/udev/rules.d/95-ceph-osd.rules'
exec { $ceph_check_udev:
command => "/bin/true # comment to satisfy puppet syntax requirements

View File

@ -29,20 +29,6 @@ describe 'ceph::osd' do
'/srv'
end
it { is_expected.to contain_exec('ceph-osd-zap-/srv').with(
'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
if [ -b /srv ]; then
ceph-disk zap /srv
fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
! test -b /srv ||
test $(parted -ms /srv p 2>&1 | egrep -c 'Error.*unrecognised disk label') -eq 0
",
'logoutput' => true,
) }
it { is_expected.to contain_exec('ceph-osd-check-udev-/srv').with(
'command' => "/bin/true # comment to satisfy puppet syntax requirements
# Before Infernalis the udev rules race causing the activation to fail so we
@ -114,34 +100,6 @@ ls -ld /var/lib/ceph/osd/ceph-* | grep ' /srv\$'
}
end
it { is_expected.to contain_exec('ceph-osd-zap-/srv/data').with(
'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
if [ -b /srv/data ]; then
ceph-disk zap /srv/data
fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
! test -b /srv/data ||
test $(parted -ms /srv/data p 2>&1 | egrep -c 'Error.*unrecognised disk label') -eq 0
",
'logoutput' => true,
) }
it { is_expected.to contain_exec('ceph-osd-zap-/srv/data-/srv/journal').with(
'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
if [ -b /srv/journal ]; then
ceph-disk zap /srv/journal
fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
! test -b /srv/journal ||
test $(parted -ms /srv/journal p 2>&1 | egrep -c 'Error.*unrecognised disk label') -eq 0
",
'logoutput' => true,
) }
it { is_expected.to contain_exec('ceph-osd-check-udev-/srv/data').with(
'command' => "/bin/true # comment to satisfy puppet syntax requirements
# Before Infernalis the udev rules race causing the activation to fail so we