Merge lp:~gandelman-a/charms/precise/swift-proxy/upgrade into lp:~openstack-charmers/charms/precise/swift-proxy/ha-support

Proposed by Adam Gandelman on 2013-05-22
Status: Merged
Merged at revision: 53
Proposed branch: lp:~gandelman-a/charms/precise/swift-proxy/upgrade
Merge into: lp:~openstack-charmers/charms/precise/swift-proxy/ha-support
Diff against target: 45 lines (+21/-1)
3 files modified
hooks/swift_hooks.py (+11/-0)
hooks/swift_utils.py (+9/-0)
revision (+1/-1)
To merge this branch: bzr merge lp:~gandelman-a/charms/precise/swift-proxy/upgrade
Reviewer Review Type Date Requested Status
James Page 2013-05-22 Approve on 2013-05-29
Review via email: mp+165255@code.launchpad.net
To post a comment you must log in.
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/swift_hooks.py'
2--- hooks/swift_hooks.py 2013-04-10 19:54:18 +0000
3+++ hooks/swift_hooks.py 2013-05-22 21:51:24 +0000
4@@ -166,6 +166,17 @@
5
6
7 def config_changed():
8+ # Determine whether or not we should do an upgrade, based on the
9+ # the version offered in keyston-release.
10+ src = utils.config_get('openstack-origin')
11+ available = openstack.get_os_codename_install_source(src)
12+ installed = openstack.get_os_codename_package('python-swift')
13+ if (available and
14+ openstack.get_os_version_codename(available) > \
15+ openstack.get_os_version_codename(installed)):
16+ pkgs = swift.determine_packages(available)
17+ swift.do_openstack_upgrade(src, pkgs)
18+
19 relids = utils.relation_ids('identity-service')
20 if relids:
21 for relid in relids:
22
23=== modified file 'hooks/swift_utils.py'
24--- hooks/swift_utils.py 2013-04-11 04:27:47 +0000
25+++ hooks/swift_utils.py 2013-05-22 21:51:24 +0000
26@@ -449,3 +449,12 @@
27 apache.setup_https(namespace="swift",
28 port_maps={api_port: target_port},
29 cert=cert, key=key, ca_cert=ca_cert)
30+
31+
32+def do_openstack_upgrade(source, packages):
33+ openstack.configure_installation_source(source)
34+ os.environ['DEBIAN_FRONTEND'] = 'noninteractive'
35+ subprocess.check_call(['apt-get', 'update'])
36+ cmd = ['apt-get', '--option', 'Dpkg::Options::=--force-confnew', '-y',
37+ 'install'] + packages
38+ subprocess.check_call(cmd)
39
40=== modified file 'revision'
41--- revision 2013-05-20 10:42:56 +0000
42+++ revision 2013-05-22 21:51:24 +0000
43@@ -1,1 +1,1 @@
44-129
45+132

Subscribers

People subscribed via source and target branches