diff --git a/hooks/pg_dir_hooks.py b/hooks/pg_dir_hooks.py index 037cb9d..add2a4d 100755 --- a/hooks/pg_dir_hooks.py +++ b/hooks/pg_dir_hooks.py @@ -137,8 +137,7 @@ def config_changed(): status_set('maintenance', 'Upgrading apt packages') stop_pg() if charm_config.changed('install_sources'): - if not configure_pg_sources(): - log('IOError: /etc/apt/sources.list couldn\'t be updated') + configure_pg_sources() configure_sources(update=True) pkgs = determine_packages() for pkg in pkgs: diff --git a/hooks/pg_dir_utils.py b/hooks/pg_dir_utils.py index 4401fc7..aaa0f03 100644 --- a/hooks/pg_dir_utils.py +++ b/hooks/pg_dir_utils.py @@ -101,9 +101,8 @@ def configure_pg_sources(): sources.write(i) sources.truncate() sources.close() - return True except IOError: - return False + raise IOError('Unable to access /etc/apt/sources.list') def determine_packages():