From 52a121bd9c447e6bf97cc70c76a18b691fe460d9 Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Mon, 2 Sep 2013 13:56:19 +0200 Subject: log some usefull message upon CheckResult's failure Instead of simple 'failed', show at least what was expected and what has has been obtained. --- commands/software/lmi/scripts/software/cmd.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'commands/software') diff --git a/commands/software/lmi/scripts/software/cmd.py b/commands/software/lmi/scripts/software/cmd.py index 2c34fa6..1566c67 100644 --- a/commands/software/lmi/scripts/software/cmd.py +++ b/commands/software/lmi/scripts/software/cmd.py @@ -257,8 +257,8 @@ class Install(command.LmiCheckResult): try: software.install_from_uri(ns, _uri, force=_force) installed.append(_uri) - except errors.LmiFailed: - pass + except errors.LmiFailed as err: + LOG().warn('failed to install "%s": %s', _uri, err) for pkg_spec in package_array: identities = list(software.find_package(ns, @@ -275,8 +275,8 @@ class Install(command.LmiCheckResult): try: software.install_package(ns, identities[-1], force=_force) installed.append(pkg_spec) - except errors.LmiFailed: - pass + except errors.LmiFailed as err: + LOG().warn('failed to install "%s": %s', pkg_spec, err) return installed @@ -310,8 +310,8 @@ class Remove(command.LmiCheckResult): try: software.remove_package(ns, identity) removed.append(pkg_spec) - except errors.LmiFailed: - pass + except errors.LmiFailed as err: + LOG().warn('failed to remove "%s": %s', pkg_spec, err) return removed Software = command.register_subcommands( -- cgit