summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Client/Solaris.py28
-rw-r--r--src/lib/Client/Toolset.py2
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