From dfbe98b1178c1283b894dc81187fb91aab178d68 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Sat, 25 Jul 2009 02:42:12 +0000 Subject: Client tools: Prompt for service restart in Interactive mode (Patch from Leif Ryge) This commit causes the client tools prompt for a service restart when running in interactive mode. This keeps the client interface consistent with what happens when installing other configuration types. This commit also fixes ticket #605 Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5385 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index 9089260b0..105cff3cf 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -343,6 +343,10 @@ class SvcTool(Tool): if self.setup['servicemode'] == 'build': rc = self.stop_service(entry) else: + if self.setup['interactive']: + prompt = 'Restart service %s?: (y/N): ' % entry.get('name') + if raw_input(prompt) not in ['y', 'Y']: + continue rc = self.restart_service(entry) else: rc = self.stop_service(entry) -- cgit v1.2.3-1-g7c22