Merge lp:~hassaanp/charms/trusty/neutron-api-plumgrid/trunk into lp:~plumgrid-team/charms/trusty/neutron-api-plumgrid/trunk

Proposed by Hassaan Pasha
Status: Merged
Merged at revision: 15
Proposed branch: lp:~hassaanp/charms/trusty/neutron-api-plumgrid/trunk
Merge into: lp:~plumgrid-team/charms/trusty/neutron-api-plumgrid/trunk
Diff against target: 30 lines (+11/-1)
1 file modified
hooks/neutron_plumgrid_utils.py (+11/-1)
To merge this branch: bzr merge lp:~hassaanp/charms/trusty/neutron-api-plumgrid/trunk
Reviewer Review Type Date Requested Status
Junaid Ali Approve
Bilal Baqar Needs Information
Review via email: mp+290229@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Bilal Baqar (bbaqar) :
review: Needs Fixing
16. By Hassaan Pasha

Addressed Comments

Revision history for this message
Bilal Baqar (bbaqar) wrote :

No need to run migrate_neutron_db() for 2015.1.1.1 networking-plumgrid package.

Revision history for this message
Bilal Baqar (bbaqar) :
review: Needs Fixing
17. By Hassaan Pasha

Adding check for 2015.1.1.1

18. By Hassaan Pasha

Adding check for 2015.1.1.1 and addressing comments

Revision history for this message
Junaid Ali (junaidali) :
review: Needs Fixing
19. By Hassaan Pasha

Addressed Comments

Revision history for this message
Junaid Ali (junaidali) wrote :

Looks good to me.

review: Approve
Revision history for this message
Bilal Baqar (bbaqar) wrote :

db migration has not been tested successfully once therefore cannot merge.
Failed on 5.0

review: Needs Information
20. By Hassaan Pasha

head changed to heads

21. By Hassaan Pasha

add is leader and addressed comments

Revision history for this message
Junaid Ali (junaidali) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/neutron_plumgrid_utils.py'
2--- hooks/neutron_plumgrid_utils.py 2016-01-15 20:56:20 +0000
3+++ hooks/neutron_plumgrid_utils.py 2016-04-01 05:04:55 +0000
4@@ -13,11 +13,12 @@
5 )
6 from charmhelpers.core.hookenv import (
7 config,
8+ is_leader,
9 )
10 from charmhelpers.contrib.openstack.utils import (
11 os_release,
12 )
13-
14+import subprocess
15 import neutron_plumgrid_context
16
17 TEMPLATES = 'templates/'
18@@ -124,3 +125,12 @@
19 package_version = config('networking-plumgrid-version')
20 package_name = 'networking-plumgrid==%s' % package_version
21 pip_install(package_name, fatal=True)
22+ if is_leader() and package_version != '2015.1.1.1':
23+ migrate_neutron_db()
24+
25+
26+def migrate_neutron_db():
27+ release = os_release('neutron-common', base='kilo')
28+ cmd = [('plumgrid-db-manage' if release == 'kilo'
29+ else 'neutron-db-manage'), 'upgrade', 'heads']
30+ subprocess.check_output(cmd)

Subscribers

People subscribed via source and target branches

to all changes: