Merge lp:~ev/adt-cloud-worker/uci-nova into lp:~canonical-ci-engineering/adt-cloud-worker/uci-nova

Proposed by Evan
Status: Merged
Approved by: Celso Providelo
Approved revision: 13
Merged at revision: 8
Proposed branch: lp:~ev/adt-cloud-worker/uci-nova
Merge into: lp:~canonical-ci-engineering/adt-cloud-worker/uci-nova
Diff against target: 87 lines (+27/-21)
1 file modified
uci-nova (+27/-21)
To merge this branch: bzr merge lp:~ev/adt-cloud-worker/uci-nova
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+256687@code.launchpad.net

Commit message

Suppressing noisy output.

Description of the change

When neutron isn't installed, we produce error messages that look as though they are fatal:

Creating new SSH key on /tmp/adt-nova-8TjfiS
Creating specific nova keypair: adt-nova-8TjfiS
/usr/share/autopkgtest/ssh-setup/uci-nova: 188: /usr/share/autopkgtest/ssh-setup/uci-nova: neutron: not found
Creating specific nova security-group: adt-nova-8TjfiS
Allowing ingress SSH ...

To post a comment you must log in.
lp:~ev/adt-cloud-worker/uci-nova updated
11. By Evan

Not actually a comment.

Revision history for this message
Celso Providelo (cprov) wrote :

Thanks for preserving the "#cloud-config" watermark, I am not sure if it would work with the extra space.

Other than that, thanks for suppressing the confusing "neutron not found" message and make the output saner.

review: Approve
lp:~ev/adt-cloud-worker/uci-nova updated
12. By Evan

Be less noisy.

13. By Evan

Less noisy still.

Revision history for this message
Celso Providelo (cprov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'uci-nova'
--- uci-nova 2015-04-15 18:53:01 +0000
+++ uci-nova 2015-04-17 16:03:49 +0000
@@ -1,4 +1,4 @@
1#!/bin/sh1#!/bin/sh -eu
2#2#
3# This script is part of autopkgtest3# This script is part of autopkgtest
4# autopkgtest is a tool for testing Debian binary packages4# autopkgtest is a tool for testing Debian binary packages
@@ -122,13 +122,15 @@
122}122}
123123
124security_setup_nova() {124security_setup_nova() {
125 debug "Creating specific nova security-group: $SRVNAME"125 if ! nova secgroup-create $SRVNAME "$SRVNAME testbed" >/dev/null 2&>1; then
126 nova secgroup-create $SRVNAME "$SRVNAME testbed"126 debug "Could not create specific nova security-group: $SRVNAME"
127127 exit 1
128 debug "Allowing ingress SSH ..."128 fi
129 nova secgroup-add-rule $SRVNAME tcp 22 22 0.0.0.0/0129
130130 if ! nova secgroup-add-rule $SRVNAME tcp 22 22 0.0.0.0/0 >/dev/null 2&>1; then
131 debug "Egress traffic will respect external Firewall rules ..."131 debug "Could not allow ingress SSH."
132 exit 1
133 fi
132}134}
133135
134security_setup_neutron() {136security_setup_neutron() {
@@ -141,7 +143,7 @@
141 --format csv -c id -c security_group --quote none \143 --format csv -c id -c security_group --quote none \
142 | grep $SRVNAME | cut -d',' -f1)144 | grep $SRVNAME | cut -d',' -f1)
143 for rule_id in $DEFAULT_RULES; do145 for rule_id in $DEFAULT_RULES; do
144 neutron security-group-rule-delete $rule_id146 neutron security-group-rule-delete $rule_id
145 done147 done
146148
147 debug "Allowing ingress SSH ..."149 debug "Allowing ingress SSH ..."
@@ -185,10 +187,11 @@
185187
186 # Setup testbed security with nova or neutron according to their188 # Setup testbed security with nova or neutron according to their
187 # availability in the target cloud.189 # availability in the target cloud.
188 if ! neutron security-group-list; then190 if type neutron >/dev/null && neutron security-group-list; then
189 security_setup_nova191 debug "Setting up neutron secgroup"
192 security_setup_neutron
190 else193 else
191 security_setup_neutron194 security_setup_nova
192 fi195 fi
193 196
194 # generate cloud-init user data; mostly for manage_etc_hosts, but also get197 # generate cloud-init user data; mostly for manage_etc_hosts, but also get
@@ -315,18 +318,21 @@
315 nova console-log $SRVNAME > $CONSOLE318 nova console-log $SRVNAME > $CONSOLE
316 fi319 fi
317320
318 debug "Deleting $SRVNAME instance"321 if ! nova delete $SRVNAME >/dev/null >2&1; then
319 nova delete $SRVNAME || true322 error "Could not delete $SRVNAME instance."
320323 fi
321 debug "Deleting $SRVNAME keypair"324
322 nova keypair-delete $SRVNAME || true325 if ! nova keypair-delete $SRVNAME >2&1; then
323326 error "Could not delete $SRVNAME keypair."
324 debug "Deleting /tmp/$SRVNAME SSH keys"327 fi
325 rm -rf /tmp/$SRVNAME || true328
329 if ! rm -rf /tmp/$SRVNAME; then
330 debug "Could not delete /tmp/$SRVNAME SSH keys"
331 fi
326332
327 DELETE_CMD="neutron security-group-delete $SRVNAME"333 DELETE_CMD="neutron security-group-delete $SRVNAME"
328 if ! neutron security-group-list; then334 if ! neutron security-group-list; then
329 DELETE_CMD="nova secgroup-delete $SRVNAME"335 DELETE_CMD="nova secgroup-delete $SRVNAME"
330 fi336 fi
331337
332 debug "Deleting $SRVNAME security-group"338 debug "Deleting $SRVNAME security-group"

Subscribers

People subscribed via source and target branches

to all changes: