Merge lp:~gnuoy/charms/trusty/cisco-vpp/1515343 into lp:~openstack-charmers/charms/trusty/cisco-vpp/next

Proposed by Liam Young
Status: Merged
Merged at revision: 117
Proposed branch: lp:~gnuoy/charms/trusty/cisco-vpp/1515343
Merge into: lp:~openstack-charmers/charms/trusty/cisco-vpp/next
Prerequisite: lp:~gnuoy/charms/trusty/cisco-vpp/dhcp
Diff against target: 104 lines (+36/-3)
5 files modified
hooks/services.py (+1/-0)
hooks/vpp_data.py (+8/-0)
hooks/vpp_utils.py (+17/-2)
templates/icehouse/neutron.conf (+1/-1)
templates/qn.conf (+9/-0)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/cisco-vpp/1515343
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+278820@code.launchpad.net
To post a comment you must log in.
123. By Liam Young

Merged service_host fix in

Revision history for this message
James Page (james-page) wrote :

Minor tidy points.

review: Needs Fixing
124. By Liam Young

Merged prerequisite branch in

125. By Liam Young

Implement feedback from mp to handle the case where nova-compute does not set hugepages more neatly

Revision history for this message
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/services.py'
2--- hooks/services.py 2015-12-02 07:36:37 +0000
3+++ hooks/services.py 2015-12-02 07:36:37 +0000
4@@ -34,6 +34,7 @@
5 'data_ready': [
6 vpp_utils.install_vpp_packages,
7 vpp_utils.configure_ssh_keys,
8+ vpp_utils.ensure_vpp_running,
9 ],
10 },
11 {
12
13=== modified file 'hooks/vpp_data.py'
14--- hooks/vpp_data.py 2015-12-02 07:36:37 +0000
15+++ hooks/vpp_data.py 2015-12-02 07:36:37 +0000
16@@ -17,6 +17,7 @@
17 NEUTRON_CONF_DIR = "/etc/neutron"
18 SHARED_SECRET_FILE = "/etc/neutron/secret.txt"
19
20+
21 class NeutronPluginAPIRelation(helpers.RelationContext):
22 name = 'neutron-plugin-api'
23 interface = 'neutron-plugin-api'
24@@ -82,6 +83,13 @@
25 super(NeutronPluginRelation, self).__init__(*args, **kwargs)
26 self['shared_secret'] = self.get_metadata_secret()
27
28+ def get_data(self):
29+ super(NeutronPluginRelation, self).get_data()
30+ self['hugepage_number'] = None
31+ if self.get('neutron-plugin') and len(self['neutron-plugin']):
32+ self['hugepage_number'] = \
33+ self['neutron-plugin'][0].get('hugepage_number')
34+
35 def get_metadata_secret(self):
36 secret = None
37 if os.path.exists(os.path.dirname(SHARED_SECRET_FILE)):
38
39=== modified file 'hooks/vpp_utils.py'
40--- hooks/vpp_utils.py 2015-12-02 07:36:37 +0000
41+++ hooks/vpp_utils.py 2015-12-02 07:36:37 +0000
42@@ -17,7 +17,11 @@
43 )
44 import vpp_data
45 from charmhelpers.core.decorators import retry_on_exception
46-from charmhelpers.core.services.base import service_restart
47+from charmhelpers.core.host import (
48+ service_restart,
49+ service_stop,
50+ service_running
51+)
52
53 ODL_NODE_QUERY_PATH = '/restconf/operational/opendaylight-inventory:nodes/'
54 ODL_MAC_QUERY_PATH = '/restconf/config/neutron-vpp-map:neutron_net_map/'
55@@ -95,7 +99,18 @@
56 log('Restarting qn')
57 debug_display_qn_pci_conf()
58 service_restart('qn')
59- check_vpe_cli()
60+ try:
61+ check_vpe_cli()
62+ except subprocess.CalledProcessError as e:
63+ log('Error starting vpp, shutting down qn')
64+ service_stop('qn')
65+ subprocess.check_call(['/opt/cisco/vpe/bin/svm_cleanup'])
66+ raise e
67+
68+
69+def ensure_vpp_running(servicename):
70+ if not service_running('qn'):
71+ restart_qn()
72
73
74 def reload_apparmor():
75
76=== modified file 'templates/icehouse/neutron.conf'
77--- templates/icehouse/neutron.conf 2015-12-02 07:36:37 +0000
78+++ templates/icehouse/neutron.conf 2015-12-02 07:36:37 +0000
79@@ -2,7 +2,7 @@
80 ###############################################################################
81 # [ WARNING ]
82 # Configuration file maintained by Juju. Local changes may be overwritten.
83-# Config managed by neutron-openvswitch charm
84+# Config managed by cisco-vpp charm
85 ###############################################################################
86 [DEFAULT]
87 verbose = {{ verbose }}
88
89=== modified file 'templates/qn.conf'
90--- templates/qn.conf 2015-08-17 10:51:37 +0000
91+++ templates/qn.conf 2015-12-02 07:36:37 +0000
92@@ -1,3 +1,12 @@
93+###############################################################################
94+## [ WARNING ]
95+## Configuration file maintained by Juju. Local changes may be overwritten.
96+## Config managed by cisco-vpp charm
97+################################################################################
98+{% if hugepage_number -%}
99+# Trigger qn restart on hugepage change: {{ hugepage_number }}
100+{% endif -%}
101+
102 lc_procs = { svm_cleanup vpe confd orca }
103
104 install_root = "/opt/cisco/vpe"

Subscribers

People subscribed via source and target branches

to all changes: