[mod] please flake8 by respecting pep8 and removing except:

This commit is contained in:
Laurent Peuch 2019-02-06 19:32:35 +01:00
parent 0267a798a7
commit 169ae96f0a

View file

@ -734,8 +734,8 @@ def app_install(operation_logger, auth, app, label=None, args=None, no_remove_on
if answer.upper() != "Y": if answer.upper() != "Y":
raise YunohostError("aborting") raise YunohostError("aborting")
raw_app_list = app_list(raw=True) raw_app_list = app_list(raw=True)
if app in raw_app_list or ('@' in app) or ('http://' in app) or ('https://' in app): if app in raw_app_list or ('@' in app) or ('http://' in app) or ('https://' in app):
if app in raw_app_list: if app in raw_app_list:
state = raw_app_list[app].get("state", "notworking") state = raw_app_list[app].get("state", "notworking")
@ -1209,8 +1209,8 @@ def app_setting(app, key, value=None, delete=False):
if value is None and not delete: if value is None and not delete:
try: try:
return app_settings[key] return app_settings[key]
except: except Exception as e:
logger.debug("cannot get app setting '%s' for '%s'", key, app) logger.debug("cannot get app setting '%s' for '%s' (%s)", key, app, e)
return None return None
else: else:
if delete and key in app_settings: if delete and key in app_settings:
@ -1394,7 +1394,8 @@ def app_ssowatconf(auth):
try: try:
apps_list = app_list(installed=True)['apps'] apps_list = app_list(installed=True)['apps']
except: except Exception as e:
logger.debug("cannot get installed app list because %s", e)
apps_list = [] apps_list = []
def _get_setting(settings, name): def _get_setting(settings, name):
@ -1907,7 +1908,7 @@ def _fetch_app_from_git(app):
# we will be able to use it. Without this option all the history # we will be able to use it. Without this option all the history
# of the submodules repo is downloaded. # of the submodules repo is downloaded.
subprocess.check_call([ subprocess.check_call([
'git', 'clone', '-b', branch, '--single-branch', '--recursive', '--depth=1', url, 'git', 'clone', '-b', branch, '--single-branch', '--recursive', '--depth=1', url,
extracted_app_folder]) extracted_app_folder])
subprocess.check_call([ subprocess.check_call([
'git', 'reset', '--hard', branch 'git', 'reset', '--hard', branch
@ -1925,8 +1926,8 @@ def _fetch_app_from_git(app):
manifest['remote'] = {'type': 'git', 'url': url, 'branch': branch} manifest['remote'] = {'type': 'git', 'url': url, 'branch': branch}
try: try:
revision = _get_git_last_commit_hash(url, branch) revision = _get_git_last_commit_hash(url, branch)
except: except Exception as e:
pass logger.debug("cannot get last commit hash because: %s ", e)
else: else:
manifest['remote']['revision'] = revision manifest['remote']['revision'] = revision
else: else: