Merge lp:~gnuoy/charms/trusty/neutron-openvswitch/1421215 into lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next

Proposed by Liam Young
Status: Merged
Merged at revision: 44
Proposed branch: lp:~gnuoy/charms/trusty/neutron-openvswitch/1421215
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
Diff against target: 252 lines (+70/-27)
10 files modified
hooks/charmhelpers/contrib/openstack/amulet/deployment.py (+5/-2)
hooks/charmhelpers/contrib/python/packages.py (+2/-2)
hooks/charmhelpers/core/fstab.py (+2/-2)
hooks/charmhelpers/core/strutils.py (+38/-0)
hooks/charmhelpers/core/sysctl.py (+2/-2)
hooks/charmhelpers/core/unitdata.py (+1/-1)
hooks/charmhelpers/fetch/archiveurl.py (+10/-10)
hooks/charmhelpers/fetch/giturl.py (+1/-1)
hooks/neutron_ovs_context.py (+5/-3)
unit_tests/test_neutron_ovs_context.py (+4/-4)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/neutron-openvswitch/1421215
Reviewer Review Type Date Requested Status
Edward Hope-Morley Approve
Review via email: mp+249535@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #1954 neutron-openvswitch-next for gnuoy mp249535
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_ovs_context.py:43:80: E501 line too long (88 > 79 characters)
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10190756/
Build: http://10.245.162.77:8080/job/charm_lint_check/1954/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1744 neutron-openvswitch-next for gnuoy mp249535
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/1744/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1895 neutron-openvswitch-next for gnuoy mp249535
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/10190758/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1895/

45. By Liam Young

Fix lint

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #1957 neutron-openvswitch-next for gnuoy mp249535
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
  hooks/neutron_ovs_context.py:45:21: E126 continuation line over-indented for hanging indent
  make: *** [lint] Error 1

Full lint test output: http://paste.ubuntu.com/10194014/
Build: http://10.245.162.77:8080/job/charm_lint_check/1957/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1747 neutron-openvswitch-next for gnuoy mp249535
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/1747/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1898 neutron-openvswitch-next for gnuoy mp249535
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/10194027/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1898/

46. By Liam Young

Try to fix lint error that osci is seeing although I cannot reproduce locally

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #1970 neutron-openvswitch-next for gnuoy mp249535
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/1970/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1760 neutron-openvswitch-next for gnuoy mp249535
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/1760/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #1909 neutron-openvswitch-next for gnuoy mp249535
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/10201892/
Build: http://10.245.162.77:8080/job/charm_amulet_test/1909/

Revision history for this message
Edward Hope-Morley (hopem) wrote :
Revision history for this message
Edward Hope-Morley (hopem) :
review: Needs Fixing
47. By Liam Young

Use charmhelper bool_from_string rather than local to_boolean

Revision history for this message
Edward Hope-Morley (hopem) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/charmhelpers/contrib/openstack/amulet/deployment.py'
--- hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-01-26 09:42:44 +0000
+++ hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2015-02-16 11:16:24 +0000
@@ -71,16 +71,19 @@
71 services.append(this_service)71 services.append(this_service)
72 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',72 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
73 'ceph-osd', 'ceph-radosgw']73 'ceph-osd', 'ceph-radosgw']
74 # Openstack subordinate charms do not expose an origin option as that
75 # is controlled by the principle
76 ignore = ['neutron-openvswitch']
7477
75 if self.openstack:78 if self.openstack:
76 for svc in services:79 for svc in services:
77 if svc['name'] not in use_source:80 if svc['name'] not in use_source + ignore:
78 config = {'openstack-origin': self.openstack}81 config = {'openstack-origin': self.openstack}
79 self.d.configure(svc['name'], config)82 self.d.configure(svc['name'], config)
8083
81 if self.source:84 if self.source:
82 for svc in services:85 for svc in services:
83 if svc['name'] in use_source:86 if svc['name'] in use_source and svc['name'] not in ignore:
84 config = {'source': self.source}87 config = {'source': self.source}
85 self.d.configure(svc['name'], config)88 self.d.configure(svc['name'], config)
8689
8790
=== modified file 'hooks/charmhelpers/contrib/python/packages.py'
--- hooks/charmhelpers/contrib/python/packages.py 2015-01-26 09:42:44 +0000
+++ hooks/charmhelpers/contrib/python/packages.py 2015-02-16 11:16:24 +0000
@@ -17,8 +17,6 @@
17# You should have received a copy of the GNU Lesser General Public License17# You should have received a copy of the GNU Lesser General Public License
18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
1919
20__author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>"
21
22from charmhelpers.fetch import apt_install, apt_update20from charmhelpers.fetch import apt_install, apt_update
23from charmhelpers.core.hookenv import log21from charmhelpers.core.hookenv import log
2422
@@ -29,6 +27,8 @@
29 apt_install('python-pip')27 apt_install('python-pip')
30 from pip import main as pip_execute28 from pip import main as pip_execute
3129
30__author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>"
31
3232
33def parse_options(given, available):33def parse_options(given, available):
34 """Given a set of options, check if available"""34 """Given a set of options, check if available"""
3535
=== modified file 'hooks/charmhelpers/core/fstab.py'
--- hooks/charmhelpers/core/fstab.py 2015-01-26 09:42:44 +0000
+++ hooks/charmhelpers/core/fstab.py 2015-02-16 11:16:24 +0000
@@ -17,11 +17,11 @@
17# You should have received a copy of the GNU Lesser General Public License17# You should have received a copy of the GNU Lesser General Public License
18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
1919
20__author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>'
21
22import io20import io
23import os21import os
2422
23__author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>'
24
2525
26class Fstab(io.FileIO):26class Fstab(io.FileIO):
27 """This class extends file in order to implement a file reader/writer27 """This class extends file in order to implement a file reader/writer
2828
=== added file 'hooks/charmhelpers/core/strutils.py'
--- hooks/charmhelpers/core/strutils.py 1970-01-01 00:00:00 +0000
+++ hooks/charmhelpers/core/strutils.py 2015-02-16 11:16:24 +0000
@@ -0,0 +1,38 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# Copyright 2014-2015 Canonical Limited.
5#
6# This file is part of charm-helpers.
7#
8# charm-helpers is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License version 3 as
10# published by the Free Software Foundation.
11#
12# charm-helpers is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Lesser General Public License for more details.
16#
17# You should have received a copy of the GNU Lesser General Public License
18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
19
20
21def bool_from_string(value):
22 """Interpret string value as boolean.
23
24 Returns True if value translates to True otherwise False.
25 """
26 if isinstance(value, str):
27 value = value.lower()
28 else:
29 msg = "Unable to interpret non-string value '%s' as boolean" % (value)
30 raise ValueError(msg)
31
32 if value in ['y', 'yes', 'true', 't']:
33 return True
34 elif value in ['n', 'no', 'false', 'f']:
35 return False
36
37 msg = "Unable to interpret string value '%s' as boolean" % (value)
38 raise ValueError(msg)
039
=== modified file 'hooks/charmhelpers/core/sysctl.py'
--- hooks/charmhelpers/core/sysctl.py 2015-02-11 12:37:28 +0000
+++ hooks/charmhelpers/core/sysctl.py 2015-02-16 11:16:24 +0000
@@ -17,8 +17,6 @@
17# You should have received a copy of the GNU Lesser General Public License17# You should have received a copy of the GNU Lesser General Public License
18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.18# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
1919
20__author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>'
21
22import yaml20import yaml
2321
24from subprocess import check_call22from subprocess import check_call
@@ -29,6 +27,8 @@
29 ERROR,27 ERROR,
30)28)
3129
30__author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>'
31
3232
33def create(sysctl_dict, sysctl_file):33def create(sysctl_dict, sysctl_file):
34 """Creates a sysctl.conf file from a YAML associative array34 """Creates a sysctl.conf file from a YAML associative array
3535
=== modified file 'hooks/charmhelpers/core/unitdata.py'
--- hooks/charmhelpers/core/unitdata.py 2015-02-11 12:37:28 +0000
+++ hooks/charmhelpers/core/unitdata.py 2015-02-16 11:16:24 +0000
@@ -435,7 +435,7 @@
435 os.path.join(charm_dir, 'revision')).read().strip()435 os.path.join(charm_dir, 'revision')).read().strip()
436 charm_rev = charm_rev or '0'436 charm_rev = charm_rev or '0'
437 revs = self.kv.get('charm_revisions', [])437 revs = self.kv.get('charm_revisions', [])
438 if not charm_rev in revs:438 if charm_rev not in revs:
439 revs.append(charm_rev.strip() or '0')439 revs.append(charm_rev.strip() or '0')
440 self.kv.set('charm_revisions', revs)440 self.kv.set('charm_revisions', revs)
441441
442442
=== modified file 'hooks/charmhelpers/fetch/archiveurl.py'
--- hooks/charmhelpers/fetch/archiveurl.py 2015-01-26 09:42:44 +0000
+++ hooks/charmhelpers/fetch/archiveurl.py 2015-02-16 11:16:24 +0000
@@ -18,6 +18,16 @@
18import hashlib18import hashlib
19import re19import re
2020
21from charmhelpers.fetch import (
22 BaseFetchHandler,
23 UnhandledSource
24)
25from charmhelpers.payload.archive import (
26 get_archive_handler,
27 extract,
28)
29from charmhelpers.core.host import mkdir, check_hash
30
21import six31import six
22if six.PY3:32if six.PY3:
23 from urllib.request import (33 from urllib.request import (
@@ -35,16 +45,6 @@
35 )45 )
36 from urlparse import urlparse, urlunparse, parse_qs46 from urlparse import urlparse, urlunparse, parse_qs
3747
38from charmhelpers.fetch import (
39 BaseFetchHandler,
40 UnhandledSource
41)
42from charmhelpers.payload.archive import (
43 get_archive_handler,
44 extract,
45)
46from charmhelpers.core.host import mkdir, check_hash
47
4848
49def splituser(host):49def splituser(host):
50 '''urllib.splituser(), but six's support of this seems broken'''50 '''urllib.splituser(), but six's support of this seems broken'''
5151
=== modified file 'hooks/charmhelpers/fetch/giturl.py'
--- hooks/charmhelpers/fetch/giturl.py 2015-01-26 09:42:44 +0000
+++ hooks/charmhelpers/fetch/giturl.py 2015-02-16 11:16:24 +0000
@@ -32,7 +32,7 @@
32 apt_install("python-git")32 apt_install("python-git")
33 from git import Repo33 from git import Repo
3434
35from git.exc import GitCommandError35from git.exc import GitCommandError # noqa E402
3636
3737
38class GitUrlFetchHandler(BaseFetchHandler):38class GitUrlFetchHandler(BaseFetchHandler):
3939
=== modified file 'hooks/neutron_ovs_context.py'
--- hooks/neutron_ovs_context.py 2014-10-10 09:55:20 +0000
+++ hooks/neutron_ovs_context.py 2015-02-16 11:16:24 +0000
@@ -6,12 +6,12 @@
6 unit_get,6 unit_get,
7)7)
8from charmhelpers.core.host import list_nics, get_nic_hwaddr8from charmhelpers.core.host import list_nics, get_nic_hwaddr
9from charmhelpers.core.strutils import bool_from_string
9from charmhelpers.contrib.openstack import context10from charmhelpers.contrib.openstack import context
10from charmhelpers.core.host import service_running, service_start11from charmhelpers.core.host import service_running, service_start
11from charmhelpers.contrib.network.ovs import add_bridge, add_bridge_port12from charmhelpers.contrib.network.ovs import add_bridge, add_bridge_port
12from charmhelpers.contrib.openstack.utils import get_host_ip13from charmhelpers.contrib.openstack.utils import get_host_ip
13from charmhelpers.contrib.network.ip import get_address_in_network14from charmhelpers.contrib.network.ip import get_address_in_network
14
15import re15import re
1616
17OVS_BRIDGE = 'br-int'17OVS_BRIDGE = 'br-int'
@@ -33,9 +33,11 @@
33 if 'l2-population' not in rdata:33 if 'l2-population' not in rdata:
34 continue34 continue
35 neutron_settings = {35 neutron_settings = {
36 'l2_population': rdata['l2-population'],36 'l2_population': bool_from_string(rdata['l2-population']),
37 'neutron_security_groups': rdata['neutron-security-groups'],
38 'overlay_network_type': rdata['overlay-network-type'],37 'overlay_network_type': rdata['overlay-network-type'],
38 'neutron_security_groups': bool_from_string(
39 rdata['neutron-security-groups']
40 ),
39 }41 }
40 # Override with configuration if set to true42 # Override with configuration if set to true
41 if config('disable-security-groups'):43 if config('disable-security-groups'):
4244
=== modified file 'unit_tests/test_neutron_ovs_context.py'
--- unit_tests/test_neutron_ovs_context.py 2014-10-10 09:55:20 +0000
+++ unit_tests/test_neutron_ovs_context.py 2015-02-16 11:16:24 +0000
@@ -88,8 +88,8 @@
88 _is_clus.return_value = False88 _is_clus.return_value = False
89 self.related_units.return_value = ['unit1']89 self.related_units.return_value = ['unit1']
90 self.relation_ids.return_value = ['rid2']90 self.relation_ids.return_value = ['rid2']
91 self.test_relation.set({'neutron-security-groups': True,91 self.test_relation.set({'neutron-security-groups': 'True',
92 'l2-population': True,92 'l2-population': 'True',
93 'overlay-network-type': 'gre',93 'overlay-network-type': 'gre',
94 })94 })
95 self.get_host_ip.return_value = '127.0.0.15'95 self.get_host_ip.return_value = '127.0.0.15'
@@ -141,8 +141,8 @@
141 self.test_config.set('disable-security-groups', True)141 self.test_config.set('disable-security-groups', True)
142 self.related_units.return_value = ['unit1']142 self.related_units.return_value = ['unit1']
143 self.relation_ids.return_value = ['rid2']143 self.relation_ids.return_value = ['rid2']
144 self.test_relation.set({'neutron-security-groups': True,144 self.test_relation.set({'neutron-security-groups': 'True',
145 'l2-population': True,145 'l2-population': 'True',
146 'overlay-network-type': 'gre',146 'overlay-network-type': 'gre',
147 })147 })
148 self.get_host_ip.return_value = '127.0.0.15'148 self.get_host_ip.return_value = '127.0.0.15'

Subscribers

People subscribed via source and target branches