projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switch SO and UI from fedora to Ubuntu
[osm/devops.git]
/
jenkins
/
common
/
container
diff --git
a/jenkins/common/container
b/jenkins/common/container
index
5c0ef95
..
400e38a
100644
(file)
--- a/
jenkins/common/container
+++ b/
jenkins/common/container
@@
-21,7
+21,7
@@
container_exists() {
if [ $# -ne 1 ]; then
FATAL "arg is container name"
fi
if [ $# -ne 1 ]; then
FATAL "arg is container name"
fi
- lxc config show $1
2>&1 >/dev/null
+ lxc config show $1
>/dev/null 2>&1
if [ $? -eq 0 ]; then
DEBUG "container $1 exists"
return 0
if [ $? -eq 0 ]; then
DEBUG "container $1 exists"
return 0
@@
-55,6
+55,12
@@
container_exec() {
DEBUG "exec in $container \"$*\""
lxc exec "$container" -- $*
}
DEBUG "exec in $container \"$*\""
lxc exec "$container" -- $*
}
+container_exec_stderr() {
+ container="$1"
+ shift
+ DEBUG "exec in $container \"$*\""
+ lxc exec "$container" -- $* 2>&1
+}
wait_container_up() {
[ $# -eq 1 ] || FATAL "arg is container name got $# args - $*"
wait_container_up() {
[ $# -eq 1 ] || FATAL "arg is container name got $# args - $*"
@@
-62,7
+68,7
@@
wait_container_up() {
RE="1 received"
while [ $ct -lt 60 ]; do
let ct=ct+1
RE="1 received"
while [ $ct -lt 60 ]; do
let ct=ct+1
- output=$(container_exec "$1" ping -c 1 google.com)
+ output=$(container_exec
_stderr
"$1" ping -c 1 google.com)
if [[ $output =~ $RE ]]; then
DEBUG "$1 is up"
return
if [[ $output =~ $RE ]]; then
DEBUG "$1 is up"
return