• 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

Revision30d4ea631493bc5a3b023d31b5e522147edfb036 (tree)
Time2010-06-08 00:06:53
AuthorDejan Muhamedagic <dejan@hell...>
CommiterDejan Muhamedagic

Log Message

Medium: Shell: add exit codes for non-interactive use
(transplanted from fa850388db09fa998ec0a85db9bab75c0986b280)

Change Summary

Incremental Difference

diff -r a648284c08b4 -r 30d4ea631493 shell/modules/main.py
--- a/shell/modules/main.py Mon Sep 20 12:20:58 2010 +0200
+++ b/shell/modules/main.py Mon Jun 07 17:06:53 2010 +0200
@@ -237,9 +237,12 @@
237237 print msg
238238 usage()
239239
240+ # this special case is silly, but we have to keep it to
241+ # preserve the backward compatibility
240242 if len(args) == 1 and args[0].startswith("conf"):
241243 parse_line(levels,["configure"])
242- options.interactive = True
244+ if not inp_file and sys.stdin.isatty():
245+ options.interactive = True
243246 elif len(args) > 0:
244247 err_buf.reset_lineno()
245248 options.interactive = False
@@ -266,14 +269,21 @@
266269 if options.interactive and not options.batch:
267270 setup_readline()
268271
272+ rc = 0
269273 while True:
270274 if options.interactive and not options.batch:
271275 vars.prompt = "crm(%s)%s# " % (cib_prompt(),levels.getprompt())
272276 inp = multi_input(vars.prompt)
273277 if inp == None:
274- cmd_exit("eof")
275- try: parse_line(levels,shlex.split(inp))
278+ if options.interactive:
279+ cmd_exit("eof")
280+ else:
281+ cmd_exit("eof", rc)
282+ try:
283+ if not parse_line(levels,shlex.split(inp)):
284+ rc = 1
276285 except ValueError, msg:
286+ rc = 1
277287 common_err(msg)
278288
279289 # vim:ts=4:sw=4:et:
diff -r a648284c08b4 -r 30d4ea631493 shell/modules/ui.py.in
--- a/shell/modules/ui.py.in Mon Sep 20 12:20:58 2010 +0200
+++ b/shell/modules/ui.py.in Mon Jun 07 17:06:53 2010 +0200
@@ -38,7 +38,7 @@
3838 def cmd_end(cmd,dir = ".."):
3939 "Go up one level."
4040 levels.droplevel()
41-def cmd_exit(cmd):
41+def cmd_exit(cmd,rc = 0):
4242 "Exit the crm program"
4343 cmd_end(cmd)
4444 if options.interactive and not options.batch:
@@ -49,7 +49,7 @@
4949 pass
5050 for f in vars.tmpfiles:
5151 os.unlink(f)
52- sys.exit()
52+ sys.exit(rc)
5353
5454 class UserInterface(object):
5555 '''
Show on old repository browser