• R/O
  • SSH

pm_diskd: Commit

※ リポジトリは、pm-diskd ブランチが https://github.com/linux-ha-japan/pm_diskd-1.0 へ、pm-diskd-2.0ブランチが https://github.com/linux-ha-japan/pm_diskd へ移行しました。

Pacemaker 対応ディスク故障監視機能。

Pacemaker-1.0公式リポジトリのクローンに対し、パッチ作成用のブランチを作成して管理する。
ブランチ名: pm-diskd

初回 hg clone 実行後は、hg update -r pm-diskd を実行すること。

Heartbeat-2.1.4 用 hb-diskd(*) のPacemaker対応版
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10555


Commit MetaInfo

Revisionbe75d2736156d07088211321f250c3db018a0ba0 (tree)
Time2010-08-14 01:05:48
AuthorDejan Muhamedagic <dejan@hell...>
CommiterDejan Muhamedagic

Log Message

Medium: Shell: refine the node delete command

- don't try to remove the node if it's not in the CIB
- crm_node seems to return a wrong exit code, ignore that for the

time being

- also, if the node is not reported by crm_node -l, it may be

that it hasn't been around for a while, so we still proceed to
remove it from the CIB

- more logging
(transplanted from c8a0da78ada88e0c56e7115444941457b95ad5ca)

Change Summary

Incremental Difference

diff -r 4cb5d5ff2cfd -r be75d2736156 shell/modules/ui.py.in
--- a/shell/modules/ui.py.in Wed Aug 04 18:38:38 2010 +0200
+++ b/shell/modules/ui.py.in Fri Aug 13 18:05:48 2010 +0200
@@ -1064,6 +1064,9 @@
10641064 'usage: delete <node>'
10651065 if not is_name_sane(node):
10661066 return False
1067+ if not node in listnodes():
1068+ common_err("node %s not found in the CIB" % node)
1069+ return False
10671070 rc = True
10681071 if cluster_stack() == "heartbeat":
10691072 rc = ext_cmd(self.hb_delnode%node) == 0
@@ -1079,18 +1082,28 @@
10791082 if a[1] == node:
10801083 node_states[a[2]] = 1
10811084 if a[2] == "lost":
1082- if ext_cmd("%s --force -R %s" % (self.crm_node,a[0])) != 0:
1083- rc = False
1084- if not "lost" in node_states:
1085- common_err('node %s/state "lost" not found in the id list' % node)
1086- if "member" in node_states:
1087- common_info("node %s appears to be still active" % node)
1085+ ec = ext_cmd("%s --force -R %s" % (self.crm_node,a[0]))
1086+ if ec != 0:
1087+ common_warn('"%s --force -R %s" failed, rc=%d' % (self.crm_node,a[0],ec))
1088+ if not node_states:
1089+ common_info("node %s not found by %s" % (node,self.crm_node))
1090+ elif "member" in node_states:
1091+ common_info("node %s appears to be still active" % node)
1092+ common_info("check output of %s -l" % self.crm_node)
1093+ rc = False
1094+ elif not "lost" in node_states:
1095+ common_err("node %s's state not recognized: %s" % (node,node_states.keys()))
10881096 common_info("check output of %s -l" % self.crm_node)
10891097 rc = False
10901098 if rc:
10911099 if ext_cmd(self.node_delete%node) != 0 or \
10921100 ext_cmd(self.node_delete_status%node) != 0:
1101+ common_err("failed to remove %s from the CIB" % node)
10931102 rc = False
1103+ if rc:
1104+ common_info("node %s deleted" % node)
1105+ else:
1106+ common_err('failed to delete node %s' % node)
10941107 return rc
10951108 def attribute(self,cmd,*args):
10961109 """usage:
Show on old repository browser