diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-08-30 20:41:02 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-08-30 20:41:02 +0000 |
commit | 5eeebbdd09c81a2f0ef84be58b64a0f8b6529bc9 (patch) | |
tree | 3b27c0f682d9dda36adc9808d426d6bd74bb08d3 /src | |
parent | 327c8984ea1285791264df10b82a0a01aaff8561 (diff) | |
download | bcfg2-5eeebbdd09c81a2f0ef84be58b64a0f8b6529bc9.tar.gz bcfg2-5eeebbdd09c81a2f0ef84be58b64a0f8b6529bc9.tar.bz2 bcfg2-5eeebbdd09c81a2f0ef84be58b64a0f8b6529bc9.zip |
Fix Interactive mode spacing
Fix Solaris service removal
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2155 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Solaris.py | 28 | ||||
-rw-r--r-- | src/lib/Client/Toolset.py | 2 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/lib/Client/Solaris.py b/src/lib/Client/Solaris.py index 78f124783..6f3aca358 100644 --- a/src/lib/Client/Solaris.py +++ b/src/lib/Client/Solaris.py @@ -224,14 +224,26 @@ class ToolsetImpl(Toolset): [self.pkgwork['remove'].remove(pkg) for pkg in enrmpkgs] else: self.logger.info("Need to remove packages: %s" % (self.pkgwork['remove'])) - if len(self.extra_services) > 0: - if self.setup['remove'] in ['all', 'services']: - self.logger.info("Removing services: %s" % (self.extra_services)) - for service in self.extra_services: - if not self.saferun("/usr/sbin/svcadm disable %s" % service)[0]: - self.extra_services.remove(service) - else: - self.logger.info("Need to remove services: %s" % (self.extra_services)) + if len(self.extra_services) > 0: + self.logger.info("Here") + self.logger.info('removal mode is: %s' % (self.setup)) + if self.setup['remove'] in ['all', 'services']: + self.logger.info("Removing services: %s" % (self.extra_services)) + for service in [svc for svc in self.extra_services if not svc.startswith('lrc:')]: + if not self.saferun("/usr/sbin/svcadm disable %s" % service)[0]: + self.extra_services.remove(service) + for svc in [svc for svc in self.extra_services if svc.startswith('lrc:')]: + loc = svc[4:].replace('_', '.') + self.logger.info("Renaming file %s to %s" % \ + (loc, loc.replace('/S', '/DISABLED.S'))) + try: + os.rename(loc, loc.replace('/S', '/DISABLED.S')) + self.extra_services.remove(svc) + except OSError: + self.logger.error("Failed to rename %s" % loc) + + else: + self.logger.info("Need to remove services: %s" % (self.extra_services)) def Install(self): '''Local install method handling noaskfiles''' diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index 66c32568e..c6522954b 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -571,7 +571,7 @@ class Toolset(object): self.iinst = []; for entry in work: try: - if raw_input("Would you like to install %s%s? (y/N): " % (entry.tag, entry.get('name'))) in ['y','Y']: + if raw_input("Would you like to install %s: %s? (y/N): " % (entry.tag, entry.get('name'))) in ['y','Y']: self.iinst.append((entry.tag, entry.get('name'))) except: continue |