~kampka/ubuntu/quantal/lxc/upstart-instance

« back to all changes in this revision

Viewing changes to debian/patches/0204-ubuntu-cloud-userdata-path

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2012-08-30 10:05:06 UTC
  • Revision ID: package-import@ubuntu.com-20120830100506-ep8o8prv5cpu7yud
Tags: 0.8.0~rc1-4ubuntu32
* 0204-ubuntu-cloud-userdata-path: Fix broken behavior when a relative
  path is passed into '--userdata' argument.  (LP: #1043582)
* 0205-lxc-ls-manpage-document-two-lines: Document the default two-line
  output format of lxc-ls.  (LP: #1043018)
* lxc-start-ephemeral: support fedora and centos  (LP: #1042431)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: lxc-ubuntu-cloud: get full pathname to userdata file
 
2
 When passing '--userdata somefile' to the ubuntu-cloud template, a user
 
3
 may pass a relative pathname.  The template uses the filename after
 
4
 changing current directory, so store the full pathname for the userdata
 
5
 file instead of a potential relative pathname.
 
6
Author: Serge Hallyn <serge.hallyn@ubuntu.com>
 
7
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1043582
 
8
Forwarded: yes
 
9
 
 
10
Index: lxc/templates/lxc-ubuntu-cloud.in
 
11
===================================================================
 
12
--- lxc.orig/templates/lxc-ubuntu-cloud.in      2012-08-30 09:48:55.396845000 -0500
 
13
+++ lxc/templates/lxc-ubuntu-cloud.in   2012-08-30 09:58:33.047759242 -0500
 
14
@@ -221,9 +221,13 @@
 
15
     exit 1
 
16
 fi
 
17
 
 
18
-if [ -n "$userdata" -a ! -f "$userdata" ]; then
 
19
-    echo "Userdata does not exist"
 
20
-    exit 1
 
21
+if [ -n "$userdata" ]; then
 
22
+    if [ ! -f "$userdata" ]; then
 
23
+        echo "Userdata ($userdata) does not exist"
 
24
+        exit 1
 
25
+    else
 
26
+        userdata=`readlink -f $userdata`
 
27
+    fi
 
28
 fi
 
29
 
 
30
 if [ -z "$path" ]; then