summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-08-29 20:12:54 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-08-29 20:12:54 +0000
commit2ec7c7a2e69d678a2c2310f38c707a4131aa331c (patch)
tree8571c01bebcad79d329e8c16fdff2ab5a7f80818 /src/lib
parent62160aa444ff7c2bef9ebc7629ac52217e7427e3 (diff)
downloadbcfg2-2ec7c7a2e69d678a2c2310f38c707a4131aa331c.tar.gz
bcfg2-2ec7c7a2e69d678a2c2310f38c707a4131aa331c.tar.bz2
bcfg2-2ec7c7a2e69d678a2c2310f38c707a4131aa331c.zip
More solaris fixups
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2145 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Client/Solaris.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/lib/Client/Solaris.py b/src/lib/Client/Solaris.py
index 10464de78..b67e45142 100644
--- a/src/lib/Client/Solaris.py
+++ b/src/lib/Client/Solaris.py
@@ -2,7 +2,7 @@
'''This provides bcfg2 support for Solaris'''
__revision__ = '$Revision$'
-import os
+import os, lxml.etree
from glob import glob
from os import stat, unlink
from re import compile as regcompile
@@ -115,6 +115,7 @@ class ToolsetImpl(Toolset):
def InstallService(self, entry):
'''Install Service entry'''
+ print lxml.etree.tostring(entry)
if not entry.attrib.has_key('status'):
self.logger.info('Insufficient information for Service %s; cannot Install' % entry.get('name'))
return False
@@ -146,7 +147,17 @@ class ToolsetImpl(Toolset):
print "Enabling Service %s" % (entry.attrib['name'])
else:
if entry.get('FMRI').startswith('lrc'):
- pass
+ loc = entry.get("FMRI")[4:].replace('_', ',')
+ try:
+ stat(loc.replace('/S', '/Disabled.'))
+ self.logger.debug("Renaming file %s to %s" % \
+ (loc.replace('/S', '/DISABLED'), loc))
+ os.rename(loc.replace('/S', '/DISABLED'), loc)
+ cmdrc = 0
+ except:
+ self.logger.debug("Failed to rename %s to %s" \
+ % (loc.replace('/S', '/DISABLED'), loc))
+ cmdrc = 1
else:
cmdrc = self.saferun("/usr/sbin/svcadm enable -r %s" % (entry.attrib['FMRI']))[0]
return cmdrc == 0
@@ -236,6 +247,6 @@ class ToolsetImpl(Toolset):
if service.get("FMRI").startswith('lrc'):
Toolset.RestartService(self, service)
else:
- if entry.get('status') == 'on':
+ if service.get('status') == 'on':
self.logger.debug("Restarting service %s" % (service.get("FMRI")))
self.saferun("svcadm restart %s" % (service.get("FMRI")))