Remove patch pupet on upgrade osd

this is not required after merge
https://review.openstack.org/#/c/203639/

Change-Id: I67fbcd77ab3437443219c34ee3ddaf7895b068ce
Closes-bug: 1621436
This commit is contained in:
Sergey Abramov 2016-09-07 18:20:33 +03:00
parent 3315d741f2
commit 349073cbe3
3 changed files with 0 additions and 83 deletions

View File

@ -15,7 +15,6 @@ import logging
from octane.handlers import upgrade
from octane.util import ceph
from octane.util import node as node_util
from octane.util import puppet
from octane.util import subprocess
LOG = logging.getLogger(__name__)
@ -23,7 +22,6 @@ LOG = logging.getLogger(__name__)
class CephOsdUpgrade(upgrade.UpgradeHandler):
env_with_set_noout = set()
patched_nodes = set()
def preupgrade(self):
try:
@ -33,10 +31,6 @@ class CephOsdUpgrade(upgrade.UpgradeHandler):
def prepare(self):
self.preserve_partition()
# patch only on first prepare run
if not self.patched_nodes:
puppet.patch_modules()
self.patched_nodes.add(self.node.data['id'])
if self.env.data['id'] not in self.env_with_set_noout:
self.env_with_set_noout.add(self.env.data['id'])
ceph.set_osd_noout(self.env)
@ -46,9 +40,6 @@ class CephOsdUpgrade(upgrade.UpgradeHandler):
if self.env.data['id'] in self.env_with_set_noout:
ceph.unset_osd_noout(self.env)
self.env_with_set_noout.remove(self.env.data['id'])
self.patched_nodes.remove(self.node.data['id'])
if not self.patched_nodes:
puppet.patch_modules(revert=True)
def preserve_partition(self):
partition = 'ceph'

View File

@ -1,72 +0,0 @@
diff --git a/deployment/puppet/ceph/manifests/osds.pp b/deployment/puppet/ceph/manifests/osds.pp
index 3281415..4d2b31e 100644
--- /ceph/manifests/osds.pp
+++ /ceph/manifests/osds.pp
@@ -1,8 +1,28 @@
-# prepare and bring online the devices listed in $::ceph::osd_devices
+# == Class: ceph::osd
+#
+# Prepare and bring online the OSD devices
+#
+# ==== Parameters
+#
+# [*devices*]
+# (optional) Array. This is the list of OSD devices identified by the facter.
+#
class ceph::osds (
$devices = $::ceph::osd_devices,
){
+ exec { 'udevadm trigger':
+ command => 'udevadm trigger',
+ returns => 0,
+ logoutput => true,
+ } ->
+
+ exec {'ceph-disk activate-all':
+ command => 'ceph-disk activate-all',
+ returns => [0, 1],
+ logoutput => true,
+ } ->
+
firewall { '011 ceph-osd allow':
chain => 'INPUT',
dport => '6800-7100',
@@ -11,5 +31,4 @@ class ceph::osds (
} ->
ceph::osds::osd{ $devices: }
-
}
diff --git a/deployment/puppet/ceph/manifests/osds/osd.pp b/deployment/puppet/ceph/manifests/osds/osd.pp
index b8fd18e..153b84d 100644
--- /ceph/manifests/osds/osd.pp
+++ /ceph/manifests/osds/osd.pp
@@ -1,3 +1,7 @@
+# == Define: ceph::osds::osd
+#
+# Prepare and activate OSD nodes on the node
+#
define ceph::osds::osd () {
# ${name} format is DISK[:JOURNAL]
@@ -18,8 +22,8 @@ define ceph::osds::osd () {
tries => 2, # This is necessary because of race for mon creating keys
try_sleep => 1,
logoutput => true,
- unless => "grep -q ${data_device_name} /proc/mounts",
- } ->
+ unless => "ceph-disk list | fgrep -q -e '${data_device_name} ceph data, active' -e '${data_device_name} ceph data, prepared'",
+ } -> Exec["ceph-deploy osd activate ${deploy_device_name}"]
exec { "ceph-deploy osd activate ${deploy_device_name}":
command => "ceph-deploy osd activate ${deploy_device_name}",
@@ -27,7 +31,7 @@ define ceph::osds::osd () {
tries => 3,
logoutput => true,
timeout => 0,
- unless => "ceph osd dump | grep -q \"osd.$(sed -nEe 's|${data_device_name}\\ .*ceph-([0-9]+).*$|\\1|p' /proc/mounts)\\ up\\ .*\\ in\\ \"",
+ onlyif => "ceph-disk list | fgrep -q -e '${data_device_name} ceph data, prepared'",
}
}

View File

@ -32,7 +32,6 @@ def test_parser(mocker, octane_app):
[(1, 1), (2, 2)]
])
def test_patch_and_revert_only_once(mocker, env_node_ids):
patch_mock = mocker.patch("octane.util.puppet.patch_modules")
mocker.patch("octane.util.ceph.check_cluster")
mocker.patch("octane.util.node.preserve_partition")
set_ceph_noout_mock = mocker.patch("octane.util.ceph.set_osd_noout")
@ -59,7 +58,6 @@ def test_patch_and_revert_only_once(mocker, env_node_ids):
handler.prepare()
for handler in handlers:
handler.postdeploy()
assert [mock.call(), mock.call(revert=True)] == patch_mock.call_args_list
env_calls = [mock.call(e) for e in envs.values()]
assert env_calls == set_ceph_noout_mock.call_args_list
assert env_calls == unset_ceph_noout_mock.call_args_list