summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools/__init__.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2013-06-02 08:49:18 -0500
committerSol Jerome <sol.jerome@gmail.com>2013-06-02 08:49:18 -0500
commit6e8031680422a238fd8ea9fbc5ea04f2fd1e2a57 (patch)
tree88fd244823f8f5c8779c8eeaa61d31ee7e0467c1 /src/lib/Bcfg2/Client/Tools/__init__.py
parenteadc444fd49644c02241ad18acedede62747010f (diff)
downloadbcfg2-6e8031680422a238fd8ea9fbc5ea04f2fd1e2a57.tar.gz
bcfg2-6e8031680422a238fd8ea9fbc5ea04f2fd1e2a57.tar.bz2
bcfg2-6e8031680422a238fd8ea9fbc5ea04f2fd1e2a57.zip
Services: Add new bootstatus attribute
This new attribute allows the specification of a boot-time status separately from the current 'status' attribute. This allows for more fine-grained control over e.g. services that are really just boot scripts. Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools/__init__.py')
-rw-r--r--src/lib/Bcfg2/Client/Tools/__init__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/__init__.py b/src/lib/Bcfg2/Client/Tools/__init__.py
index c5a5ee4d6..11fe55bd6 100644
--- a/src/lib/Bcfg2/Client/Tools/__init__.py
+++ b/src/lib/Bcfg2/Client/Tools/__init__.py
@@ -519,6 +519,22 @@ class SvcTool(Tool):
"""
return '/etc/init.d/%s %s' % (service.get('name'), action)
+ def get_bootstatus(self, service):
+ """ Return the bootstatus attribute if it exists.
+
+ :param service: The service entry
+ :type service: lxml.etree._Element
+ :returns: string or None - Value of bootstatus if it exists. If
+ bootstatus is unspecified and status is not *ignore*,
+ return value of status. If bootstatus is unspecified
+ and status is *ignore*, return None.
+ """
+ if service.get('bootstatus') is not None:
+ return service.get('bootstatus')
+ elif service.get('status') != 'ignore':
+ return service.get('status')
+ return None
+
def start_service(self, service):
""" Start a service.