Merge lp:~hopem/charms/trusty/neutron-api/lp1518975 into lp:~openstack-charmers-archive/charms/trusty/neutron-api/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 174
Proposed branch: lp:~hopem/charms/trusty/neutron-api/lp1518975
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-api/next
Diff against target: 201 lines (+80/-29)
5 files modified
hooks/charmhelpers/contrib/openstack/amulet/deployment.py (+1/-1)
hooks/charmhelpers/contrib/openstack/context.py (+11/-7)
hooks/charmhelpers/contrib/openstack/utils.py (+45/-13)
hooks/charmhelpers/contrib/python/packages.py (+22/-7)
tests/charmhelpers/contrib/openstack/amulet/deployment.py (+1/-1)
To merge this branch: bzr merge lp:~hopem/charms/trusty/neutron-api/lp1518975
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+285742@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 #218 neutron-api-next for hopem mp285742
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/218/

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

charm_unit_test #206 neutron-api-next for hopem mp285742
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/206/

174. By Edward Hope-Morley

charm-helpers sync

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

charm_lint_check #226 neutron-api-next for hopem mp285742
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/226/

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

charm_unit_test #214 neutron-api-next for hopem mp285742
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/214/

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

charm_amulet_test #103 neutron-api-next for hopem mp285742
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/103/

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 2016-01-26 09:35:40 +0000
+++ hooks/charmhelpers/contrib/openstack/amulet/deployment.py 2016-02-11 15:44:49 +0000
@@ -121,7 +121,7 @@
121121
122 # Charms which should use the source config option122 # Charms which should use the source config option
123 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',123 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
124 'ceph-osd', 'ceph-radosgw']124 'ceph-osd', 'ceph-radosgw', 'ceph-mon']
125125
126 # Charms which can not use openstack-origin, ie. many subordinates126 # Charms which can not use openstack-origin, ie. many subordinates
127 no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',127 no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',
128128
=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
--- hooks/charmhelpers/contrib/openstack/context.py 2016-01-08 02:37:42 +0000
+++ hooks/charmhelpers/contrib/openstack/context.py 2016-02-11 15:44:49 +0000
@@ -90,6 +90,12 @@
90from charmhelpers.contrib.openstack.utils import get_host_ip90from charmhelpers.contrib.openstack.utils import get_host_ip
91from charmhelpers.core.unitdata import kv91from charmhelpers.core.unitdata import kv
9292
93try:
94 import psutil
95except ImportError:
96 apt_install('python-psutil', fatal=True)
97 import psutil
98
93CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'99CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'
94ADDRESS_TYPES = ['admin', 'internal', 'public']100ADDRESS_TYPES = ['admin', 'internal', 'public']
95101
@@ -1258,13 +1264,11 @@
12581264
1259 @property1265 @property
1260 def num_cpus(self):1266 def num_cpus(self):
1261 try:1267 # NOTE: use cpu_count if present (16.04 support)
1262 from psutil import NUM_CPUS1268 if hasattr(psutil, 'cpu_count'):
1263 except ImportError:1269 return psutil.cpu_count()
1264 apt_install('python-psutil', fatal=True)1270 else:
1265 from psutil import NUM_CPUS1271 return psutil.NUM_CPUS
1266
1267 return NUM_CPUS
12681272
1269 def __call__(self):1273 def __call__(self):
1270 multiplier = config('worker-multiplier') or 01274 multiplier = config('worker-multiplier') or 0
12711275
=== modified file 'hooks/charmhelpers/contrib/openstack/utils.py'
--- hooks/charmhelpers/contrib/openstack/utils.py 2016-01-26 09:35:40 +0000
+++ hooks/charmhelpers/contrib/openstack/utils.py 2016-02-11 15:44:49 +0000
@@ -25,6 +25,7 @@
25import re25import re
2626
27import six27import six
28import tempfile
28import traceback29import traceback
29import uuid30import uuid
30import yaml31import yaml
@@ -41,6 +42,7 @@
41 config,42 config,
42 log as juju_log,43 log as juju_log,
43 charm_dir,44 charm_dir,
45 DEBUG,
44 INFO,46 INFO,
45 related_units,47 related_units,
46 relation_ids,48 relation_ids,
@@ -347,12 +349,42 @@
347349
348350
349def import_key(keyid):351def import_key(keyid):
350 cmd = "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 " \352 key = keyid.strip()
351 "--recv-keys %s" % keyid353 if (key.startswith('-----BEGIN PGP PUBLIC KEY BLOCK-----') and
352 try:354 key.endswith('-----END PGP PUBLIC KEY BLOCK-----')):
353 subprocess.check_call(cmd.split(' '))355 juju_log("PGP key found (looks like ASCII Armor format)", level=DEBUG)
354 except subprocess.CalledProcessError:356 juju_log("Importing ASCII Armor PGP key", level=DEBUG)
355 error_out("Error importing repo key %s" % keyid)357 with tempfile.NamedTemporaryFile() as keyfile:
358 with open(keyfile.name, 'w') as fd:
359 fd.write(key)
360 fd.write("\n")
361
362 cmd = ['apt-key', 'add', keyfile.name]
363 try:
364 subprocess.check_call(cmd)
365 except subprocess.CalledProcessError:
366 error_out("Error importing PGP key '%s'" % key)
367 else:
368 juju_log("PGP key found (looks like Radix64 format)", level=DEBUG)
369 juju_log("Importing PGP key from keyserver", level=DEBUG)
370 cmd = ['apt-key', 'adv', '--keyserver',
371 'hkp://keyserver.ubuntu.com:80', '--recv-keys', key]
372 try:
373 subprocess.check_call(cmd)
374 except subprocess.CalledProcessError:
375 error_out("Error importing PGP key '%s'" % key)
376
377
378def get_source_and_pgp_key(input):
379 """Look for a pgp key ID or ascii-armor key in the given input."""
380 index = input.strip()
381 index = input.rfind('|')
382 if index < 0:
383 return input, None
384
385 key = input[index + 1:].strip('|')
386 source = input[:index]
387 return source, key
356388
357389
358def configure_installation_source(rel):390def configure_installation_source(rel):
@@ -364,16 +396,16 @@
364 with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f:396 with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f:
365 f.write(DISTRO_PROPOSED % ubuntu_rel)397 f.write(DISTRO_PROPOSED % ubuntu_rel)
366 elif rel[:4] == "ppa:":398 elif rel[:4] == "ppa:":
367 src = rel399 src, key = get_source_and_pgp_key(rel)
400 if key:
401 import_key(key)
402
368 subprocess.check_call(["add-apt-repository", "-y", src])403 subprocess.check_call(["add-apt-repository", "-y", src])
369 elif rel[:3] == "deb":404 elif rel[:3] == "deb":
370 l = len(rel.split('|'))405 src, key = get_source_and_pgp_key(rel)
371 if l == 2:406 if key:
372 src, key = rel.split('|')
373 juju_log("Importing PPA key from keyserver for %s" % src)
374 import_key(key)407 import_key(key)
375 elif l == 1:408
376 src = rel
377 with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f:409 with open('/etc/apt/sources.list.d/juju_deb.list', 'w') as f:
378 f.write(src)410 f.write(src)
379 elif rel[:6] == 'cloud:':411 elif rel[:6] == 'cloud:':
380412
=== modified file 'hooks/charmhelpers/contrib/python/packages.py'
--- hooks/charmhelpers/contrib/python/packages.py 2016-01-04 21:28:17 +0000
+++ hooks/charmhelpers/contrib/python/packages.py 2016-02-11 15:44:49 +0000
@@ -19,20 +19,35 @@
1919
20import os20import os
21import subprocess21import subprocess
22import sys
2223
23from charmhelpers.fetch import apt_install, apt_update24from charmhelpers.fetch import apt_install, apt_update
24from charmhelpers.core.hookenv import charm_dir, log25from charmhelpers.core.hookenv import charm_dir, log
2526
26try:
27 from pip import main as pip_execute
28except ImportError:
29 apt_update()
30 apt_install('python-pip')
31 from pip import main as pip_execute
32
33__author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>"27__author__ = "Jorge Niedbalski <jorge.niedbalski@canonical.com>"
3428
3529
30def pip_execute(*args, **kwargs):
31 """Overriden pip_execute() to stop sys.path being changed.
32
33 The act of importing main from the pip module seems to cause add wheels
34 from the /usr/share/python-wheels which are installed by various tools.
35 This function ensures that sys.path remains the same after the call is
36 executed.
37 """
38 try:
39 _path = sys.path
40 try:
41 from pip import main as _pip_execute
42 except ImportError:
43 apt_update()
44 apt_install('python-pip')
45 from pip import main as _pip_execute
46 _pip_execute(*args, **kwargs)
47 finally:
48 sys.path = _path
49
50
36def parse_options(given, available):51def parse_options(given, available):
37 """Given a set of options, check if available"""52 """Given a set of options, check if available"""
38 for key, value in sorted(given.items()):53 for key, value in sorted(given.items()):
3954
=== modified file 'tests/charmhelpers/contrib/openstack/amulet/deployment.py'
--- tests/charmhelpers/contrib/openstack/amulet/deployment.py 2016-01-26 09:35:40 +0000
+++ tests/charmhelpers/contrib/openstack/amulet/deployment.py 2016-02-11 15:44:49 +0000
@@ -121,7 +121,7 @@
121121
122 # Charms which should use the source config option122 # Charms which should use the source config option
123 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',123 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
124 'ceph-osd', 'ceph-radosgw']124 'ceph-osd', 'ceph-radosgw', 'ceph-mon']
125125
126 # Charms which can not use openstack-origin, ie. many subordinates126 # Charms which can not use openstack-origin, ie. many subordinates
127 no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',127 no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',

Subscribers

People subscribed via source and target branches