Merge lp:~junaidali/charms/trusty/plumgrid-gateway/trunk into lp:~plumgrid-team/charms/trusty/plumgrid-gateway/trunk

Proposed by Junaid Ali on 2016-05-21
Status: Merged
Merged at revision: 29
Proposed branch: lp:~junaidali/charms/trusty/plumgrid-gateway/trunk
Merge into: lp:~plumgrid-team/charms/trusty/plumgrid-gateway/trunk
Diff against target: 94 lines (+28/-4)
5 files modified
hooks/pg_gw_hooks.py (+4/-1)
hooks/pg_gw_utils.py (+17/-0)
templates/kilo/00-pg.conf (+2/-1)
templates/kilo/ifcs.conf (+2/-2)
templates/kilo/plumgrid.conf (+3/-0)
To merge this branch: bzr merge lp:~junaidali/charms/trusty/plumgrid-gateway/trunk
Reviewer Review Type Date Requested Status
Bilal Baqar 2016-05-21 Pending
Review via email: mp+295386@code.launchpad.net
To post a comment you must log in.
29. By Bilal Baqar on 2016-05-28

5.1 changes
- configure-pg-sources added
- updated templates

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/pg_gw_hooks.py'
2--- hooks/pg_gw_hooks.py 2016-04-06 16:45:27 +0000
3+++ hooks/pg_gw_hooks.py 2016-05-23 10:31:43 +0000
4@@ -34,7 +34,8 @@
5 load_iptables,
6 restart_on_change,
7 restart_on_stop,
8- director_cluster_ready
9+ director_cluster_ready,
10+ configure_pg_sources
11 )
12
13 hooks = Hooks()
14@@ -92,6 +93,8 @@
15 charm_config.changed('iovisor-build')):
16 stop_pg()
17 status_set('maintenance', 'Upgrading apt packages')
18+ if charm_config.changed('install_sources'):
19+ configure_pg_sources()
20 configure_sources(update=True)
21 pkgs = determine_packages()
22 for pkg in pkgs:
23
24=== modified file 'hooks/pg_gw_utils.py'
25--- hooks/pg_gw_utils.py 2016-05-01 02:22:48 +0000
26+++ hooks/pg_gw_utils.py 2016-05-23 10:31:43 +0000
27@@ -42,6 +42,7 @@
28 os_release,
29 )
30
31+SOURCES_LIST = '/etc/apt/sources.list'
32 LXC_CONF = "/etc/libvirt/lxc.conf"
33 TEMPLATES = 'templates/'
34 PG_LXC_DATA_PATH = '/var/lib/libvirt/filesystems/plumgrid-data'
35@@ -78,6 +79,22 @@
36 ])
37
38
39+def configure_pg_sources():
40+ '''
41+ Returns true if install sources is updated in sources.list file
42+ '''
43+ try:
44+ with open(SOURCES_LIST, 'r+') as sources:
45+ all_lines = sources.readlines()
46+ sources.seek(0)
47+ for i in (line for line in all_lines if "plumgrid" not in line):
48+ sources.write(i)
49+ sources.truncate()
50+ sources.close()
51+ except IOError:
52+ log('Unable to update /etc/apt/sources.list')
53+
54+
55 def determine_packages():
56 '''
57 Returns list of packages required by PLUMgrid Gateway as specified
58
59=== modified file 'templates/kilo/00-pg.conf'
60--- templates/kilo/00-pg.conf 2016-04-06 16:45:27 +0000
61+++ templates/kilo/00-pg.conf 2016-05-23 10:31:43 +0000
62@@ -1,2 +1,3 @@
63 $template ls_json,"{{'{'}}{{'%'}}timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:@source_host%,%msg:::json%}"
64-:syslogtag,isequal,"pg:" @{{ opsvm_ip }}:6000;ls_json
65+if $syslogtag == 'pg:' and not ($msg contains 'dht_cli_') then @{{ opsvm_ip }}:6000;ls_json
66+:msg, contains, "VM Interface Stats" ~
67
68=== modified file 'templates/kilo/ifcs.conf'
69--- templates/kilo/ifcs.conf 2015-11-22 03:26:23 +0000
70+++ templates/kilo/ifcs.conf 2016-05-23 10:31:43 +0000
71@@ -1,7 +1,7 @@
72 {{ fabric_interface }} = fabric_core host
73 {% if ext_interfaces -%}
74-{% for ip in ext_interfaces -%}
75-{{ ip }} = access_phys
76+{% for dev in ext_interfaces -%}
77+{{ dev }} = access_phys
78 {% endfor -%}
79 {% endif -%}
80
81
82=== modified file 'templates/kilo/plumgrid.conf'
83--- templates/kilo/plumgrid.conf 2016-03-27 15:24:34 +0000
84+++ templates/kilo/plumgrid.conf 2016-05-23 10:31:43 +0000
85@@ -5,6 +5,9 @@
86 plumgrid_rsync_port=2222
87 plumgrid_rest_addr=0.0.0.0:9180
88 fabric_mode={{ fabric_mode }}
89+plumgrid_syslog_ng_ip={{ plumgrid_syslog_ng_ip }}
90+plumgrid_syslog_ng_port={{ plumgrid_syslog_ng_port }}
91+plumgrid_monitor_interval={{ plumgrid_monitor_interval }}
92 start_plumgrid_iovisor=yes
93 start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`
94 location=

Subscribers

People subscribed via source and target branches