Updated configure_pg_sources
This commit is contained in:
parent
9b7ed6df3f
commit
4999e4d5f3
|
@ -94,8 +94,7 @@ def config_changed():
|
||||||
stop_pg()
|
stop_pg()
|
||||||
status_set('maintenance', 'Upgrading apt packages')
|
status_set('maintenance', 'Upgrading apt packages')
|
||||||
if charm_config.changed('install_sources'):
|
if charm_config.changed('install_sources'):
|
||||||
if not configure_pg_sources():
|
configure_pg_sources()
|
||||||
log('IOError: /etc/apt/sources.list couldn\'t be updated')
|
|
||||||
configure_sources(update=True)
|
configure_sources(update=True)
|
||||||
pkgs = determine_packages()
|
pkgs = determine_packages()
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
|
|
|
@ -91,9 +91,8 @@ def configure_pg_sources():
|
||||||
sources.write(i)
|
sources.write(i)
|
||||||
sources.truncate()
|
sources.truncate()
|
||||||
sources.close()
|
sources.close()
|
||||||
return True
|
|
||||||
except IOError:
|
except IOError:
|
||||||
return False
|
raise IOError('Unable to access /etc/apt/sources.list')
|
||||||
|
|
||||||
|
|
||||||
def determine_packages():
|
def determine_packages():
|
||||||
|
|
Loading…
Reference in New Issue