Merge lp:~corey.bryant/charms/trusty/swift-proxy/git-1531612 into lp:~openstack-charmers-archive/charms/trusty/swift-proxy/next

Proposed by Corey Bryant
Status: Merged
Merged at revision: 132
Proposed branch: lp:~corey.bryant/charms/trusty/swift-proxy/git-1531612
Merge into: lp:~openstack-charmers-archive/charms/trusty/swift-proxy/next
Diff against target: 128 lines (+21/-16)
4 files modified
charmhelpers/contrib/openstack/context.py (+12/-2)
charmhelpers/contrib/openstack/templates/haproxy.cfg (+3/-2)
charmhelpers/contrib/openstack/utils.py (+6/-9)
charmhelpers/fetch/giturl.py (+0/-3)
To merge this branch: bzr merge lp:~corey.bryant/charms/trusty/swift-proxy/git-1531612
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+281963@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #15691 swift-proxy-next for corey.bryant mp281963
    UNIT OK: passed

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

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

charm_lint_check #16808 swift-proxy-next for corey.bryant mp281963
    LINT OK: passed

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

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

charm_amulet_test #8583 swift-proxy-next for corey.bryant mp281963
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8583/

Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/context.py'
2--- charmhelpers/contrib/openstack/context.py 2016-01-04 21:31:31 +0000
3+++ charmhelpers/contrib/openstack/context.py 2016-01-08 03:14:12 +0000
4@@ -57,6 +57,7 @@
5 get_nic_hwaddr,
6 mkdir,
7 write_file,
8+ pwgen,
9 )
10 from charmhelpers.contrib.hahelpers.cluster import (
11 determine_apache_port,
12@@ -87,6 +88,8 @@
13 is_bridge_member,
14 )
15 from charmhelpers.contrib.openstack.utils import get_host_ip
16+from charmhelpers.core.unitdata import kv
17+
18 CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'
19 ADDRESS_TYPES = ['admin', 'internal', 'public']
20
21@@ -636,11 +639,18 @@
22 ctxt['ipv6'] = True
23 ctxt['local_host'] = 'ip6-localhost'
24 ctxt['haproxy_host'] = '::'
25- ctxt['stat_port'] = ':::8888'
26 else:
27 ctxt['local_host'] = '127.0.0.1'
28 ctxt['haproxy_host'] = '0.0.0.0'
29- ctxt['stat_port'] = ':8888'
30+
31+ ctxt['stat_port'] = '8888'
32+
33+ db = kv()
34+ ctxt['stat_password'] = db.get('stat-password')
35+ if not ctxt['stat_password']:
36+ ctxt['stat_password'] = db.set('stat-password',
37+ pwgen(32))
38+ db.flush()
39
40 for frontend in cluster_hosts:
41 if (len(cluster_hosts[frontend]['backends']) > 1 or
42
43=== modified file 'charmhelpers/contrib/openstack/templates/haproxy.cfg'
44--- charmhelpers/contrib/openstack/templates/haproxy.cfg 2015-12-07 23:19:28 +0000
45+++ charmhelpers/contrib/openstack/templates/haproxy.cfg 2016-01-08 03:14:12 +0000
46@@ -33,13 +33,14 @@
47 timeout server 30000
48 {%- endif %}
49
50-listen stats {{ stat_port }}
51+listen stats
52+ bind {{ local_host }}:{{ stat_port }}
53 mode http
54 stats enable
55 stats hide-version
56 stats realm Haproxy\ Statistics
57 stats uri /
58- stats auth admin:password
59+ stats auth admin:{{ stat_password }}
60
61 {% if frontends -%}
62 {% for service, ports in service_ports.items() -%}
63
64=== modified file 'charmhelpers/contrib/openstack/utils.py'
65--- charmhelpers/contrib/openstack/utils.py 2016-01-05 11:49:14 +0000
66+++ charmhelpers/contrib/openstack/utils.py 2016-01-08 03:14:12 +0000
67@@ -593,7 +593,7 @@
68 return yaml.load(projects_yaml)
69
70
71-def git_clone_and_install(projects_yaml, core_project, depth=1):
72+def git_clone_and_install(projects_yaml, core_project):
73 """
74 Clone/install all specified OpenStack repositories.
75
76@@ -643,6 +643,9 @@
77 for p in projects['repositories']:
78 repo = p['repository']
79 branch = p['branch']
80+ depth = '1'
81+ if 'depth' in p.keys():
82+ depth = p['depth']
83 if p['name'] == 'requirements':
84 repo_dir = _git_clone_and_install_single(repo, branch, depth,
85 parent_dir, http_proxy,
86@@ -687,19 +690,13 @@
87 """
88 Clone and install a single git repository.
89 """
90- dest_dir = os.path.join(parent_dir, os.path.basename(repo))
91-
92 if not os.path.exists(parent_dir):
93 juju_log('Directory already exists at {}. '
94 'No need to create directory.'.format(parent_dir))
95 os.mkdir(parent_dir)
96
97- if not os.path.exists(dest_dir):
98- juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch))
99- repo_dir = install_remote(repo, dest=parent_dir, branch=branch,
100- depth=depth)
101- else:
102- repo_dir = dest_dir
103+ juju_log('Cloning git repo: {}, branch: {}'.format(repo, branch))
104+ repo_dir = install_remote(repo, dest=parent_dir, branch=branch, depth=depth)
105
106 venv = os.path.join(parent_dir, 'venv')
107
108
109=== modified file 'charmhelpers/fetch/giturl.py'
110--- charmhelpers/fetch/giturl.py 2016-01-04 21:31:31 +0000
111+++ charmhelpers/fetch/giturl.py 2016-01-08 03:14:12 +0000
112@@ -22,7 +22,6 @@
113 filter_installed_packages,
114 apt_install,
115 )
116-from charmhelpers.core.host import mkdir
117
118 if filter_installed_packages(['git']) != []:
119 apt_install(['git'])
120@@ -62,8 +61,6 @@
121 else:
122 dest_dir = os.path.join(os.environ.get('CHARM_DIR'), "fetched",
123 branch_name)
124- if not os.path.exists(dest_dir):
125- mkdir(dest_dir, perms=0o755)
126 try:
127 self.clone(source, dest_dir, branch, depth)
128 except OSError as e:

Subscribers

People subscribed via source and target branches