Merge lp:~benji/ubuntu/precise/lxc/bug-945183 into lp:ubuntu/precise/lxc

Proposed by Benji York
Status: Merged
Merged at revision: 71
Proposed branch: lp:~benji/ubuntu/precise/lxc/bug-945183
Merge into: lp:ubuntu/precise/lxc
Diff against target: 78 lines (+22/-4)
2 files modified
debian/changelog (+6/-0)
debian/local/lxc-start-ephemeral (+16/-4)
To merge this branch: bzr merge lp:~benji/ubuntu/precise/lxc/bug-945183
Reviewer Review Type Date Requested Status
Serge Hallyn (community) Approve
Ubuntu branches Pending
Review via email: mp+95678@code.launchpad.net

Description of the change

This fixes bug 945183 by adding -u (--user) and -S (--ssh-key) options.

To post a comment you must log in.
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks, looks great.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-02-28 15:03:45 +0000
+++ debian/changelog 2012-03-02 22:26:20 +0000
@@ -1,3 +1,9 @@
1lxc (0.7.5-3ubuntu32) precise; urgency=low
2
3 * add user (-u) and key (-S) to lxc-start-ephemeral. (LP: #945183)
4
5 -- benji <benji.york@canonical.com> Fri, 02 Mar 2012 17:20:46 -0500
6
1lxc (0.7.5-3ubuntu31) precise; urgency=low7lxc (0.7.5-3ubuntu31) precise; urgency=low
28
3 * 0050-clone-lvm-sizes: make lxc-clone with lvm snapshots create a9 * 0050-clone-lvm-sizes: make lxc-clone with lvm snapshots create a
410
=== modified file 'debian/local/lxc-start-ephemeral' (properties changed: -x to +x)
--- debian/local/lxc-start-ephemeral 2012-02-16 16:47:03 +0000
+++ debian/local/lxc-start-ephemeral 2012-03-02 22:26:20 +0000
@@ -8,7 +8,7 @@
8LXC_BIND=""8LXC_BIND=""
99
10usage() {10usage() {
11 echo "usage: lxc-start-ephemeral [-h] [-b bdir] -o orig -- [COMMAND [ARGS...]]"11 echo "usage: lxc-start-ephemeral [-h] [-b bdir] [-u user] [-S key] -o orig -- [COMMAND [ARGS...]]"
12}12}
1313
14help() {14help() {
@@ -19,13 +19,15 @@
19 echo "Options:"19 echo "Options:"
20 echo "orig : name of the original container"20 echo "orig : name of the original container"
21 echo "bdir : directory to bind mount into container"21 echo "bdir : directory to bind mount into container"
22 echo "user : the user to connect to the container as"
23 echo "key : the path to the SSH key to use to connect"
22 echo24 echo
23 echo "if a COMMAND is given, then the container will run only as long"25 echo "if a COMMAND is given, then the container will run only as long"
24 echo "as the command runs. If no COMMAND is given, this command will"26 echo "as the command runs. If no COMMAND is given, this command will"
25 echo "wait until the container is shut down"27 echo "wait until the container is shut down"
26}28}
2729
28shortoptions='hb:o:'30shortoptions='hb:o:u:S:'
29longoptions='help,orig:,bdir:'31longoptions='help,orig:,bdir:'
3032
31LXC_RUNNING=033LXC_RUNNING=0
@@ -74,6 +76,16 @@
74 LXC_BIND=$176 LXC_BIND=$1
75 shift77 shift
76 ;;78 ;;
79 -u|--user)
80 shift
81 LXC_USER=$1
82 shift
83 ;;
84 -S|--ssh-key)
85 shift
86 LXC_KEY="-i $1"
87 shift
88 ;;
77 --)89 --)
78 shift90 shift
79 break;;91 break;;
@@ -85,7 +97,7 @@
85 esac97 esac
86done98done
8799
88LXC_USER=`id -un`100LXC_USER=${LXC_USER:-`id -un`}
89101
90# validation102# validation
91103
@@ -144,7 +156,7 @@
144 # Repeatedly try to connect over SSH until we either succeed156 # Repeatedly try to connect over SSH until we either succeed
145 # or time out.157 # or time out.
146 for i in $(seq 1 30); do158 for i in $(seq 1 30); do
147 ssh -n -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $LXC_USER@$IP_ADDRESS -- "$@"159 ssh -n -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $LXC_KEY $LXC_USER@$IP_ADDRESS -- "$@"
148 if [ ! 255 -eq $? ]; then160 if [ ! 255 -eq $? ]; then
149 # If ssh returns 255 then its connection failed.161 # If ssh returns 255 then its connection failed.
150 # Anything else is either success (status 0) or a162 # Anything else is either success (status 0) or a

Subscribers

People subscribed via source and target branches

to all changes: