From 56b5eaa49b86d08b715d213b3de4889e0cd22ca6 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 18 Oct 2005 04:55:48 +0000 Subject: switch to new fam API (Logical change 1.337) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1388 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/Bcfg2debug | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/sbin/Bcfg2debug') diff --git a/src/sbin/Bcfg2debug b/src/sbin/Bcfg2debug index a1d163b1b..522baff0a 100644 --- a/src/sbin/Bcfg2debug +++ b/src/sbin/Bcfg2debug @@ -1,13 +1,14 @@ #!/usr/bin/env python - -__revision__ = '$Revision$' '''This tool loads the Bcfg2 core into an interactive debugger''' +__revision__ = '$Revision$' + from sys import argv from time import sleep from Bcfg2.Server.Core import Core, CoreInitError -def input(): +def get_input(): + '''read commands from stdin''' try: return raw_input('> ').split(" ") except: @@ -24,11 +25,10 @@ if __name__ == '__main__': except CoreInitError, msg: print "Core load failed because %s" % msg raise SystemExit, 1 - while core.fam.fm.pending(): - while core.fam.fm.pending(): - core.fam.HandleEvent() + for i in range(25): + core.fam.Service() sleep(0.5) - cmd = input() + cmd = get_input() while cmd != ['']: if cmd[0] in ['exit', 'quit']: raise SystemExit, 0 @@ -70,4 +70,4 @@ if __name__ == '__main__': sleep(0.5) else: print "Unknown command %s" % cmd[0] - cmd = input() + cmd = get_input() -- cgit v1.2.3-1-g7c22