summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-01-08 21:54:14 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-01-08 21:54:14 +0000
commitb53f3ecdeca20740c974bd7cbf29ce7498dffd8f (patch)
treefc6e7cf4e4f13d4c9c1041c84ee4163fa25c1c57 /src/lib
parentc1aa7f13c53c6093c72dc968aa0818c8bba9265b (diff)
downloadbcfg2-b53f3ecdeca20740c974bd7cbf29ce7498dffd8f.tar.gz
bcfg2-b53f3ecdeca20740c974bd7cbf29ce7498dffd8f.tar.bz2
bcfg2-b53f3ecdeca20740c974bd7cbf29ce7498dffd8f.zip
Two client updates
- add default toolset support for debian - Add support for clearing maintenance modes in smf git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2632 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Client/Frame.py3
-rw-r--r--src/lib/Client/Tools/SMF.py10
2 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index 16fa3e11a..d6424b603 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -15,7 +15,8 @@ def promptFilter(prompt, entries):
continue
return ret
-toolset_defs = {'rh': {'Service':'chkconfig', 'Package':'rpm'}}
+toolset_defs = {'rh': {'Service':'chkconfig', 'Package':'rpm'},
+ 'debian': {'Service':'deb', 'Package':'deb'}}
class Frame:
'''Frame is the container for all Tool objects and state information'''
diff --git a/src/lib/Client/Tools/SMF.py b/src/lib/Client/Tools/SMF.py
index 57d1ea8f7..e2ad2f80b 100644
--- a/src/lib/Client/Tools/SMF.py
+++ b/src/lib/Client/Tools/SMF.py
@@ -84,8 +84,14 @@ class SMF(Bcfg2.Client.Tools.Tool):
% (loc.replace('/S', '/DISABLED.S'), loc))
cmdrc = 1
else:
- cmdrc = self.cmd.run("/usr/sbin/svcadm enable -r %s" % \
- (entry.get('FMRI')))[0]
+ srvdata = self.cmd.run("/usr/bin/svcs -H -o STA %s" %
+ entry.get('FMRI'))[1] [0].split()
+ if srvdata[0] == 'MNT':
+ cmdarg = 'clear'
+ else:
+ cmdarg = 'enable'
+ cmdrc = self.cmd.run("/usr/sbin/svcadm %s -r %s" % \
+ (cmdarg, entry.get('FMRI')))[0]
return cmdrc == 0
def Remove(self, svcs):