Merge lp:~gandelman-a/ubuntu/precise/cobbler/cobbler-ubuntu-import-proxy into lp:ubuntu/precise/cobbler

Proposed by Adam Gandelman
Status: Approved
Approved by: Stéphane Graber
Approved revision: 55
Proposed branch: lp:~gandelman-a/ubuntu/precise/cobbler/cobbler-ubuntu-import-proxy
Merge into: lp:ubuntu/precise/cobbler
Diff against target: 59 lines (+17/-2)
2 files modified
debian/changelog (+8/-0)
debian/cobbler-ubuntu-import (+9/-2)
To merge this branch: bzr merge lp:~gandelman-a/ubuntu/precise/cobbler/cobbler-ubuntu-import-proxy
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Ubuntu branches Pending
Review via email: mp+82763@code.launchpad.net

Description of the change

Two minor changes to cobbler-ubuntu-import:

- There is a faulty if clause when determining whether or not to test+create the $ISO_DIR if its missing, which causes the script to later fail if for whatever reason the directory is not there.

- Adds a -p argument for specifying a proxy, which is passed to wget via http_proxy environment variable. orchestra-import-isos will be able to make use of this.

To post a comment you must log in.
55. By Adam Gandelman

Update debian/changelog.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Looks good. Uploading

review: Approve

Unmerged revisions

55. By Adam Gandelman

Update debian/changelog.

54. By Adam Gandelman

debian/cobbler-ubuntu-import: Support wget'ing via a proxy via -p argument. Correct error so that $ISO_DIR actually gets created if it doesn't exist

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-11-17 20:40:30 +0000
+++ debian/changelog 2011-11-19 01:41:24 +0000
@@ -1,3 +1,11 @@
1cobbler (2.2.2-0ubuntu4) UNRELEASED; urgency=low
2
3 * debian/cobbler-ubuntu-import: Support wget'ing via a proxy via -p argument,
4 correct error so that $ISO_DIR actually gets created if it doesn't exist.
5 (LP: #892409)
6
7 -- Adam Gandelman <adamg@canonical.com> Fri, 18 Nov 2011 17:35:59 -0800
8
1cobbler (2.2.2-0ubuntu3) precise; urgency=low9cobbler (2.2.2-0ubuntu3) precise; urgency=low
210
3 * debian/patches/47_ubuntu_add_codenames.patch:11 * debian/patches/47_ubuntu_add_codenames.patch:
412
=== modified file 'debian/cobbler-ubuntu-import'
--- debian/cobbler-ubuntu-import 2011-10-24 19:29:26 +0000
+++ debian/cobbler-ubuntu-import 2011-11-19 01:41:24 +0000
@@ -28,6 +28,7 @@
28 not exist in $ISO_DIR28 not exist in $ISO_DIR
29 -r | --remove remove cobbler profile/distro and cached ISO29 -r | --remove remove cobbler profile/distro and cached ISO
30 -u | --update update iso, import, replace outdated distro and profile30 -u | --update update iso, import, replace outdated distro and profile
31 -p | --proxy <host[:port> http proxy to use
31 -v | --verbose increase verbosity32 -v | --verbose increase verbosity
32 Note, arch can be i386, x86_64, or amd64. However,33 Note, arch can be i386, x86_64, or amd64. However,
33 the registered distro and profile will use 'x86_64' rather than 'amd64'.34 the registered distro and profile will use 'x86_64' rather than 'amd64'.
@@ -136,7 +137,7 @@
136 [ "$md5sum_local" != "$md5sum_remote" ]137 [ "$md5sum_local" != "$md5sum_remote" ]
137}138}
138139
139short_opts="Dhm:o:vcru"140short_opts="Dhm:o:p:vcru"
140long_opts="delete-iso,help,mirror:,verbose,update-check,remove"141long_opts="delete-iso,help,mirror:,verbose,update-check,remove"
141getopt_out=$(getopt --name "${0##*/}" \142getopt_out=$(getopt --name "${0##*/}" \
142 --options "${short_opts}" --long "${long_opts}" -- "$@") &&143 --options "${short_opts}" --long "${long_opts}" -- "$@") &&
@@ -155,6 +156,7 @@
155 -h|--help) Usage ; exit 0;;156 -h|--help) Usage ; exit 0;;
156 -m|--mirror) mirror=${2}; shift;;157 -m|--mirror) mirror=${2}; shift;;
157 -D|--delete-iso) delete=true;;158 -D|--delete-iso) delete=true;;
159 -p|--proxy) proxy=${2}; shift;;
158 -v|--verbose) VERBOSITY=$((${VERBOSITY}+1));;160 -v|--verbose) VERBOSITY=$((${VERBOSITY}+1));;
159 -c|--update-check) check_update=true;;161 -c|--update-check) check_update=true;;
160 -r|--remove) remove=true;;162 -r|--remove) remove=true;;
@@ -171,8 +173,13 @@
171 fail "failed to make tempdir"173 fail "failed to make tempdir"
172trap cleanup EXIT174trap cleanup EXIT
173175
176if [ -n $proxy ] ; then
177 debug "Using proxy: $proxy"
178 export http_proxy="$proxy"
179fi
180
174# program starts here181# program starts here
175if $delete; then182if ! $delete; then
176 { [ -d "$ISO_DIR" ] || mkdir -p "$ISO_DIR"; } || fail "failed to create $ISO_DIR"183 { [ -d "$ISO_DIR" ] || mkdir -p "$ISO_DIR"; } || fail "failed to create $ISO_DIR"
177fi184fi
178mkdir "$TEMP_D/mnt" || fail "failed to make tempdir/mnt"185mkdir "$TEMP_D/mnt" || fail "failed to make tempdir/mnt"

Subscribers

People subscribed via source and target branches