aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-01-17 20:06:37 -0800
committerBrian Dolbec <brian.dolbec@gmail.com>2011-01-17 20:06:37 -0800
commitd91ecb0c2e826194f88962e9d4677cf05da9c100 (patch)
treea6e27c8a887d28db78c9d297755d1134b1893401
parentadd a generator for source types the same as source uris. (diff)
downloadoverlord-d91ecb0c2e826194f88962e9d4677cf05da9c100.tar.gz
overlord-d91ecb0c2e826194f88962e9d4677cf05da9c100.tar.bz2
overlord-d91ecb0c2e826194f88962e9d4677cf05da9c100.zip
add missing output messages
-rw-r--r--layman/cli.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/layman/cli.py b/layman/cli.py
index 05d1de2..107a2aa 100644
--- a/layman/cli.py
+++ b/layman/cli.py
@@ -79,7 +79,7 @@ class ListPrinter(object):
if supported:
# Is this an official overlay?
if official:
- self.output.info(summary, 1)
+ self.output.info(summary, 1)
# Unofficial overlays will only be listed if we are not
# checking or listing verbose
elif complain:
@@ -193,11 +193,22 @@ class Main(object):
def Add(self):
''' Adds the selected overlays.
'''
+ print "Add()", self.config['add']
selection = decode_selection(self.config['add'])
+ print "selection =", selection
if 'ALL' in selection:
selection = self.api.get_available()
self.output.debug('Adding selected overlays', 6)
- return self.api.add_repos(selection)
+ result = self.api.add_repos(selection)
+ if result:
+ self.output.info('Successfully added overlay(s) '
+ ', '.join(selection) +'.', 2)
+ else:
+ errors = self.api.get_errors()
+ self.output.warn('Failed to add overlay(s).\nError was: '
+ + str('\n'.join(errors)), 2)
+ return result
+
def Sync(self):
@@ -217,7 +228,15 @@ class Main(object):
if 'ALL' in selection:
selection = self.api.get_installed()
self.output.debug('Deleting selected overlays', 6)
- return self.api.delete_repos(selection)
+ result = self.api.delete_repos(selection)
+ if result:
+ self.output.info('Successfully deleted overlay(s) ' +\
+ ', '.join(selection) + '.', 2)
+ else:
+ errors = self.api.get_errors()
+ self.output.warn('Failed to delete overlay(s).\nError was: '
+ + str('\n'.join(errors)), 2)
+ return result
def Info(self):