summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunaid Ali <junaidali@plumgrid.com>2016-05-22 11:19:46 -0400
committerJunaid Ali <junaidali@plumgrid.com>2016-05-22 11:19:46 -0400
commit4999e4d5f3a356f271b15b5983a51a914dca22d3 (patch)
treeea19906ad0eed3bc72f74329dd85f2c2334d3473
parent9b7ed6df3fd175602b7fbca6978ab9f128a06d80 (diff)
Updated configure_pg_sources
-rwxr-xr-xhooks/pg_gw_hooks.py3
-rw-r--r--hooks/pg_gw_utils.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/hooks/pg_gw_hooks.py b/hooks/pg_gw_hooks.py
index 10b5791..5818cea 100755
--- a/hooks/pg_gw_hooks.py
+++ b/hooks/pg_gw_hooks.py
@@ -94,8 +94,7 @@ def config_changed():
94 stop_pg() 94 stop_pg()
95 status_set('maintenance', 'Upgrading apt packages') 95 status_set('maintenance', 'Upgrading apt packages')
96 if charm_config.changed('install_sources'): 96 if charm_config.changed('install_sources'):
97 if not configure_pg_sources(): 97 configure_pg_sources()
98 log('IOError: /etc/apt/sources.list couldn\'t be updated')
99 configure_sources(update=True) 98 configure_sources(update=True)
100 pkgs = determine_packages() 99 pkgs = determine_packages()
101 for pkg in pkgs: 100 for pkg in pkgs:
diff --git a/hooks/pg_gw_utils.py b/hooks/pg_gw_utils.py
index 7e77a06..98ad4a4 100644
--- a/hooks/pg_gw_utils.py
+++ b/hooks/pg_gw_utils.py
@@ -91,9 +91,8 @@ def configure_pg_sources():
91 sources.write(i) 91 sources.write(i)
92 sources.truncate() 92 sources.truncate()
93 sources.close() 93 sources.close()
94 return True
95 except IOError: 94 except IOError:
96 return False 95 raise IOError('Unable to access /etc/apt/sources.list')
97 96
98 97
99def determine_packages(): 98def determine_packages():