diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 60a2b4464..cce01c9da 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1546,11 +1546,17 @@ def is_true(arg): Boolean """ - true_list = ['yes', 'Yes', 'true', 'True' ] - for string in true_list: - if arg == string: - return True - return False + if isinstance(arg, bool): + return arg + elif isinstance(arg, basestring): + true_list = ['yes', 'Yes', 'true', 'True' ] + for string in true_list: + if arg == string: + return True + return False + else: + logger.debug('arg should be a boolean or a string, got %r', arg) + return True if arg else False def random_password(length=8):