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

Proposed by Junaid Ali
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 Pending
Review via email: mp+295386@code.launchpad.net
To post a comment you must log in.
29. By Bilal Baqar

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
=== modified file 'hooks/pg_gw_hooks.py'
--- hooks/pg_gw_hooks.py 2016-04-06 16:45:27 +0000
+++ hooks/pg_gw_hooks.py 2016-05-23 10:31:43 +0000
@@ -34,7 +34,8 @@
34 load_iptables,34 load_iptables,
35 restart_on_change,35 restart_on_change,
36 restart_on_stop,36 restart_on_stop,
37 director_cluster_ready37 director_cluster_ready,
38 configure_pg_sources
38)39)
3940
40hooks = Hooks()41hooks = Hooks()
@@ -92,6 +93,8 @@
92 charm_config.changed('iovisor-build')):93 charm_config.changed('iovisor-build')):
93 stop_pg()94 stop_pg()
94 status_set('maintenance', 'Upgrading apt packages')95 status_set('maintenance', 'Upgrading apt packages')
96 if charm_config.changed('install_sources'):
97 configure_pg_sources()
95 configure_sources(update=True)98 configure_sources(update=True)
96 pkgs = determine_packages()99 pkgs = determine_packages()
97 for pkg in pkgs:100 for pkg in pkgs:
98101
=== modified file 'hooks/pg_gw_utils.py'
--- hooks/pg_gw_utils.py 2016-05-01 02:22:48 +0000
+++ hooks/pg_gw_utils.py 2016-05-23 10:31:43 +0000
@@ -42,6 +42,7 @@
42 os_release,42 os_release,
43)43)
4444
45SOURCES_LIST = '/etc/apt/sources.list'
45LXC_CONF = "/etc/libvirt/lxc.conf"46LXC_CONF = "/etc/libvirt/lxc.conf"
46TEMPLATES = 'templates/'47TEMPLATES = 'templates/'
47PG_LXC_DATA_PATH = '/var/lib/libvirt/filesystems/plumgrid-data'48PG_LXC_DATA_PATH = '/var/lib/libvirt/filesystems/plumgrid-data'
@@ -78,6 +79,22 @@
78])79])
7980
8081
82def configure_pg_sources():
83 '''
84 Returns true if install sources is updated in sources.list file
85 '''
86 try:
87 with open(SOURCES_LIST, 'r+') as sources:
88 all_lines = sources.readlines()
89 sources.seek(0)
90 for i in (line for line in all_lines if "plumgrid" not in line):
91 sources.write(i)
92 sources.truncate()
93 sources.close()
94 except IOError:
95 log('Unable to update /etc/apt/sources.list')
96
97
81def determine_packages():98def determine_packages():
82 '''99 '''
83 Returns list of packages required by PLUMgrid Gateway as specified100 Returns list of packages required by PLUMgrid Gateway as specified
84101
=== modified file 'templates/kilo/00-pg.conf'
--- templates/kilo/00-pg.conf 2016-04-06 16:45:27 +0000
+++ templates/kilo/00-pg.conf 2016-05-23 10:31:43 +0000
@@ -1,2 +1,3 @@
1$template ls_json,"{{'{'}}{{'%'}}timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:@source_host%,%msg:::json%}"1$template ls_json,"{{'{'}}{{'%'}}timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:@source_host%,%msg:::json%}"
2:syslogtag,isequal,"pg:" @{{ opsvm_ip }}:6000;ls_json2if $syslogtag == 'pg:' and not ($msg contains 'dht_cli_') then @{{ opsvm_ip }}:6000;ls_json
3:msg, contains, "VM Interface Stats" ~
34
=== modified file 'templates/kilo/ifcs.conf'
--- templates/kilo/ifcs.conf 2015-11-22 03:26:23 +0000
+++ templates/kilo/ifcs.conf 2016-05-23 10:31:43 +0000
@@ -1,7 +1,7 @@
1{{ fabric_interface }} = fabric_core host1{{ fabric_interface }} = fabric_core host
2{% if ext_interfaces -%}2{% if ext_interfaces -%}
3{% for ip in ext_interfaces -%}3{% for dev in ext_interfaces -%}
4{{ ip }} = access_phys4{{ dev }} = access_phys
5{% endfor -%}5{% endfor -%}
6{% endif -%}6{% endif -%}
77
88
=== modified file 'templates/kilo/plumgrid.conf'
--- templates/kilo/plumgrid.conf 2016-03-27 15:24:34 +0000
+++ templates/kilo/plumgrid.conf 2016-05-23 10:31:43 +0000
@@ -5,6 +5,9 @@
5plumgrid_rsync_port=22225plumgrid_rsync_port=2222
6plumgrid_rest_addr=0.0.0.0:91806plumgrid_rest_addr=0.0.0.0:9180
7fabric_mode={{ fabric_mode }}7fabric_mode={{ fabric_mode }}
8plumgrid_syslog_ng_ip={{ plumgrid_syslog_ng_ip }}
9plumgrid_syslog_ng_port={{ plumgrid_syslog_ng_port }}
10plumgrid_monitor_interval={{ plumgrid_monitor_interval }}
8start_plumgrid_iovisor=yes11start_plumgrid_iovisor=yes
9start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`12start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`
10location=13location=

Subscribers

People subscribed via source and target branches