Merge lp:~gnuoy/charms/trusty/nova-cloud-controller/lp1500589 into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liam Young on 2015-10-06
Status: Merged
Merged at revision: 198
Proposed branch: lp:~gnuoy/charms/trusty/nova-cloud-controller/lp1500589
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 43 lines (+18/-1)
2 files modified
hooks/nova_cc_utils.py (+8/-1)
unit_tests/test_nova_cc_utils.py (+10/-0)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/nova-cloud-controller/lp1500589
Reviewer Review Type Date Requested Status
Edward Hope-Morley 2015-10-06 Approve on 2015-10-07
Review via email: mp+273508@code.launchpad.net
To post a comment you must log in.

charm_lint_check #11384 nova-cloud-controller-next for gnuoy mp273508
    LINT OK: passed

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

charm_unit_test #10576 nova-cloud-controller-next for gnuoy mp273508
    UNIT OK: passed

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

charm_amulet_test #7130 nova-cloud-controller-next for gnuoy mp273508
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

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

199. By Liam Young on 2015-10-06

Fix type in length check. If all is well the cmd should return two lines

charm_lint_check #11385 nova-cloud-controller-next for gnuoy mp273508
    LINT OK: passed

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

charm_unit_test #10577 nova-cloud-controller-next for gnuoy mp273508
    UNIT OK: passed

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

200. By Liam Young on 2015-10-06

Kick osci

charm_lint_check #11387 nova-cloud-controller-next for gnuoy mp273508
    LINT OK: passed

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

charm_unit_test #10579 nova-cloud-controller-next for gnuoy mp273508
    UNIT OK: passed

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

charm_amulet_test #7132 nova-cloud-controller-next for gnuoy mp273508
    AMULET OK: passed

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

201. By Liam Young on 2015-10-06

Updated after mp review from hopem

charm_lint_check #11391 nova-cloud-controller-next for gnuoy mp273508
    LINT OK: passed

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

charm_unit_test #10583 nova-cloud-controller-next for gnuoy mp273508
    UNIT OK: passed

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

charm_amulet_test #7134 nova-cloud-controller-next for gnuoy mp273508
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

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

charm_amulet_test #7138 nova-cloud-controller-next for gnuoy mp273508
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

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

charm_amulet_test #7175 nova-cloud-controller-next for gnuoy mp273508
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

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

Edward Hope-Morley (hopem) wrote :

lgtm +1

review: Approve

charm_amulet_test #7183 nova-cloud-controller-next for gnuoy mp273508
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

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

Ryan Beisner (1chb1n) wrote :

FYI, unrelated to the changes proposed here...

https://bugs.launchpad.net/charms/+source/nova-cloud-controller/+bug/1503701

While the undercloud has elevated load, there is this race where the amulet test blindly says "create an instance right now," and the overcloud isn't quite ready for that at that moment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_cc_utils.py'
2--- hooks/nova_cc_utils.py 2015-10-02 12:05:06 +0000
3+++ hooks/nova_cc_utils.py 2015-10-06 15:50:49 +0000
4@@ -728,10 +728,17 @@
5 # The first line of output is like '# Host xx found: line 1 type RSA',
6 # which should be excluded.
7 output = subprocess.check_output(cmd).strip()
8- return output.split('\n')[1]
9 except subprocess.CalledProcessError:
10 return None
11
12+ if output:
13+ # Bug #1500589 cmd has 0 rc on precise if entry not present
14+ lines = output.split('\n')
15+ if len(lines) > 1:
16+ return lines[1]
17+
18+ return None
19+
20
21 def remove_known_host(host, unit=None, user=None):
22 log('Removing SSH known host entry for compute host at %s' % host)
23
24=== modified file 'unit_tests/test_nova_cc_utils.py'
25--- unit_tests/test_nova_cc_utils.py 2015-09-24 16:29:26 +0000
26+++ unit_tests/test_nova_cc_utils.py 2015-10-06 15:50:49 +0000
27@@ -602,6 +602,16 @@
28 _known_hosts.assert_called_with('bar', None)
29
30 @patch.object(utils, 'known_hosts')
31+ @patch('subprocess.check_output')
32+ def test_ssh_known_host_key_bug1500589(self, _check_output, _known_hosts):
33+ """On precise ssh-keygen does not error if host not found in file. So
34+ check charm processes empty output properly"""
35+ _known_hosts.return_value = '/foo/known_hosts'
36+ _check_output.return_value = ''
37+ key = utils.ssh_known_host_key('test')
38+ self.assertEquals(key, None)
39+
40+ @patch.object(utils, 'known_hosts')
41 @patch('subprocess.check_call')
42 def test_remove_known_host(self, _check_call, _known_hosts):
43 _known_hosts.return_value = '/foo/known_hosts'

Subscribers

People subscribed via source and target branches