corrections

This commit is contained in:
Irina LAMBLA 2018-12-08 00:08:07 +01:00 committed by Alexandre Aubin
parent 6614d8c76b
commit a6cce50977
2 changed files with 3 additions and 2 deletions

View file

@ -137,5 +137,5 @@ def cli(namespaces, args, use_cache=True, output_as=None,
except MoulinetteError as e: except MoulinetteError as e:
import logging import logging
logging.getLogger(namespaces[0]).error(e.strerror) logging.getLogger(namespaces[0]).error(e.strerror)
return e.errno return 1
return 0 return 0

View file

@ -414,8 +414,9 @@ def clean_session(session_id, profiles=[]):
class MoulinetteError(StandardError): class MoulinetteError(StandardError):
"""Moulinette base exception""" """Moulinette base exception"""
def __init__(self, key, *args, **kwargs): def __init__(self, key, *args, **kwargs):
msg = m18n.g(key, *args, **kwargs) msg = moulinette.m18n.g(key, *args, **kwargs)
super(MoulinetteError, self).__init__(msg) super(MoulinetteError, self).__init__(msg)
self.strerror = msg
class MoulinetteLock(object): class MoulinetteLock(object):