summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2011-04-25 14:56:19 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2011-04-25 14:56:19 -0500
commit4a693086d5f980de8407a7eaeb585aa989916f43 (patch)
tree9d00d204b231f9a6c09e24bb51bd2a05edf517ae
parentf5b33079c78dd061520fea5bd77eb16cf379193d (diff)
downloadbcfg2-4a693086d5f980de8407a7eaeb585aa989916f43.tar.gz
bcfg2-4a693086d5f980de8407a7eaeb585aa989916f43.tar.bz2
bcfg2-4a693086d5f980de8407a7eaeb585aa989916f43.zip
SvcTool: adding interactive_only mode
-rw-r--r--doc/server/plugins/generators/rules.txt5
-rw-r--r--src/lib/Client/Tools/__init__.py4
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/server/plugins/generators/rules.txt b/doc/server/plugins/generators/rules.txt
index 7233e79e5..a2953ad08 100644
--- a/doc/server/plugins/generators/rules.txt
+++ b/doc/server/plugins/generators/rules.txt
@@ -149,6 +149,11 @@ Service mode descriptions
* do not start/stop/restart this service
* service installation is not performed
+* interactive_only
+
+ * only attempt to start/stop/restart this service if the client is run interactively
+ * service installation is performed
+
* default
* perform appropriate service operations
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 7d8d58957..6a934fe52 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -352,7 +352,9 @@ class SvcTool(Tool):
return
for entry in [ent for ent in bundle if self.handlesEntry(ent)]:
- if entry.get('mode', 'default') == 'manual':
+ mode = entry.get('mode', 'default')
+ if mode == 'manual' or \
+ (mode == 'interactive_only' and not self.setup['interactive']):
continue
# need to handle servicemode = (build|default)
# need to handle mode = (default|supervised)