Merge lp:~gandelman-a/orchestra/850892 into lp:orchestra

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 303
Proposed branch: lp:~gandelman-a/orchestra/850892
Merge into: lp:orchestra
Diff against target: 90 lines (+33/-9)
2 files modified
debian/changelog (+5/-0)
provisioning-server/usr/sbin/orchestra-import-isos (+28/-9)
To merge this branch: bzr merge lp:~gandelman-a/orchestra/850892
Reviewer Review Type Date Requested Status
Andres Rodriguez Approve
Review via email: mp+83701@code.launchpad.net

Description of the change

This should merge better.

Sets default behavior to import_isos if no option has been specified.

Also, during import will check for an updated mini.iso and re-import distro if necessary, while preserving any systems and profiles that may be descendants of the original distro.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) :
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 2011-11-28 19:24:42 +0000
+++ debian/changelog 2011-11-28 22:19:26 +0000
@@ -5,6 +5,11 @@
5 /etc/avahi/services/orchestra_provisioning_server.service5 /etc/avahi/services/orchestra_provisioning_server.service
6 Advertise the orchestra provisioning service via avahi (LP: #893189)6 Advertise the orchestra provisioning service via avahi (LP: #893189)
77
8 [ Adam Gandelman ]
9 * orchestra-import-isos: import ISOs by default if no option specified
10 Check for updates for existing ISOs, download + update distro if necessary.
11 (LP: #850892)
12
8 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 28 Nov 2011 14:23:39 -050013 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 28 Nov 2011 14:23:39 -0500
914
10orchestra (2.24-0ubuntu1) precise; urgency=low15orchestra (2.24-0ubuntu1) precise; urgency=low
1116
=== modified file 'provisioning-server/usr/sbin/orchestra-import-isos'
--- provisioning-server/usr/sbin/orchestra-import-isos 2011-11-22 20:22:27 +0000
+++ provisioning-server/usr/sbin/orchestra-import-isos 2011-11-28 22:19:26 +0000
@@ -70,8 +70,11 @@
70 cobbler-ubuntu-import $r-$a70 cobbler-ubuntu-import $r-$a
71 cobbler profile edit --name="$r-$a" --kopts="$KOPTS" --kickstart="$KSDIR/orchestra.preseed"71 cobbler profile edit --name="$r-$a" --kopts="$KOPTS" --kickstart="$KSDIR/orchestra.preseed"
72 else72 else
73 # check archive for an updated ISO, update our cache if necessary
74 cobbler-ubuntu-import -c $r-$a && cobbler-ubuntu-import -u $r-$a
73 # Make sure the profile is using the orchestra preseed75 # Make sure the profile is using the orchestra preseed
74 cobbler profile edit --name="$r-$a" --kickstart="$KSDIR/orchestra.preseed"76 cobbler profile edit --name="$r-$a" --kickstart="$KSDIR/orchestra.preseed"
77
75 fi78 fi
76 # Skip if cobbler already has this distro/arch profile79 # Skip if cobbler already has this distro/arch profile
77 if ! (cobbler profile list | grep -qs " $r-$a-juju$"); then80 if ! (cobbler profile list | grep -qs " $r-$a-juju$"); then
@@ -97,13 +100,18 @@
97100
98 options:101 options:
99 -i | --import-isos Import the Ubuntu ISOs and update default102 -i | --import-isos Import the Ubuntu ISOs and update default
100 settings used for Orchestra.103 settings used for Orchestra. (default)
101 -u | --update-settings Updates all profiles based based on new settings104 -u | --update-settings Updates all profiles based on new settings
102 in /etc/orchestra/import_isos.105 in /etc/orchestra/import_isos.
103 the --import process downloads and imports a list of Ubuntu releases, adding106
104 the default Orchestra settings for each of the profiles. If the ISOs have107 The --import process downloads and imports a list of Ubuntu releases,
105 already been imported, update-settings will update all the profiles within108 adding the default Orchestra settings for each of the profiles. If a
106 cobbler based on the modifications of /etc/orchestra/import_isos.109 release has already been imported but is out of date, the updated ISO
110 will be downloaded again and reimported.
111
112 If the ISOs have already been imported, update-settings will update all
113 the profiles within cobbler based on the modifications of
114 /etc/orchestra/import_isos.
107115
108 Example:116 Example:
109 - ${0##*/} -i117 - ${0##*/} -i
@@ -119,19 +127,30 @@
119 eval set -- "${getopt_out}" ||127 eval set -- "${getopt_out}" ||
120 bad_Usage128 bad_Usage
121129
130do_import_isos=false
131do_update_settings=false
132
122while [ $# -ne 0 ]; do133while [ $# -ne 0 ]; do
123 cur=${1};134 cur=${1};
124 case "$cur" in135 case "$cur" in
125 -h|--help) Usage ; exit 0;;136 -h|--help) Usage ; exit 0;;
126 -i|--import-isos) import_isos;;137 -i|--import-isos) do_import_isos=true;;
127 -u|--update-settings) update_settings;;138 -u|--update-settings) do_update_settings=true;;
128 --) shift; break;;139 --) shift; break;;
129 esac140 esac
130 shift;141 shift;
131done142done
132143
133## check arguments here144## check arguments here
134[ $# -ne 0 ] || bad_Usage145[ $# -ne 0 ] && bad_Usage
146
147# if no action specified, import by default
148( ! $do_import_isos && ! $do_update_settings ) && do_import_isos=true
149# do not allow import + update
150( $do_import_isos && $do_update_settings ) && bad_Usage
151
152$do_import_isos && import_isos
153$do_update_settings && update_settings
135154
136# Add management classes if new have being defined.155# Add management classes if new have being defined.
137add_mgmt_classes156add_mgmt_classes

Subscribers

People subscribed via source and target branches