← Back to team overview

orchestra team mailing list archive

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

 

Adam Gandelman has proposed merging lp:~gandelman-a/orchestra/850892 into lp:orchestra.

Requested reviews:
  orchestra (orchestra)
Related bugs:
  Bug #850892 in orchestra (Ubuntu): "orchestra-import-isos does not update"
  https://bugs.launchpad.net/ubuntu/+source/orchestra/+bug/850892

For more details, see:
https://code.launchpad.net/~gandelman-a/orchestra/850892/+merge/83701

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.

-- 
https://code.launchpad.net/~gandelman-a/orchestra/850892/+merge/83701
Your team orchestra is requested to review the proposed merge of lp:~gandelman-a/orchestra/850892 into lp:orchestra.
=== 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 @@
     /etc/avahi/services/orchestra_provisioning_server.service
     Advertise the orchestra provisioning service via avahi (LP: #893189)
 
+  [ Adam Gandelman ]
+  * orchestra-import-isos: import ISOs by default if no option specified
+    Check for updates for existing ISOs, download + update distro if necessary.
+    (LP: #850892)
+
  -- Andres Rodriguez <andreserl@xxxxxxxxxx>  Mon, 28 Nov 2011 14:23:39 -0500
 
 orchestra (2.24-0ubuntu1) precise; urgency=low

=== 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 @@
 				cobbler-ubuntu-import $r-$a
 				cobbler profile edit --name="$r-$a" --kopts="$KOPTS" --kickstart="$KSDIR/orchestra.preseed"
 			else
+				# check archive for an updated ISO, update our cache if necessary
+				cobbler-ubuntu-import -c $r-$a && cobbler-ubuntu-import -u $r-$a
 				# Make sure the profile is using the orchestra preseed
 				cobbler profile edit --name="$r-$a" --kickstart="$KSDIR/orchestra.preseed"
+
 			fi
 			# Skip if cobbler already has this distro/arch profile
 			if ! (cobbler profile list | grep -qs " $r-$a-juju$"); then
@@ -97,13 +100,18 @@
 
    options:
       -i | --import-isos      Import the Ubuntu ISOs and update default
-                              settings used for Orchestra.
-      -u | --update-settings  Updates all profiles based based on new settings
+                              settings used for Orchestra. (default)
+      -u | --update-settings  Updates all profiles based on new settings
                               in /etc/orchestra/import_isos.
-   the --import process downloads and imports a list of Ubuntu releases, adding
-   the default Orchestra settings for each of the profiles. If the ISOs have
-   already been imported, update-settings will update all the profiles within
-   cobbler based on the modifications of /etc/orchestra/import_isos.
+
+   The --import process downloads and imports a list of Ubuntu releases,
+   adding the default Orchestra settings for each of the profiles.  If a
+   release has already been imported but is out of date, the updated ISO
+   will be downloaded again and reimported.
+
+   If the ISOs have already been imported, update-settings will update all
+   the profiles within cobbler based on the modifications of
+   /etc/orchestra/import_isos.
 
    Example:
     - ${0##*/} -i
@@ -119,19 +127,30 @@
         eval set -- "${getopt_out}" ||
         bad_Usage
 
+do_import_isos=false
+do_update_settings=false
+
 while [ $# -ne 0 ]; do
 	cur=${1};
 	case "$cur" in
 		-h|--help) Usage ; exit 0;;
-		-i|--import-isos) import_isos;;
-		-u|--update-settings) update_settings;;
+		-i|--import-isos) do_import_isos=true;;
+		-u|--update-settings) do_update_settings=true;;
 		--) shift; break;;
 	esac
 	shift;
 done
 
 ## check arguments here
-[ $# -ne 0 ] || bad_Usage
+[ $# -ne 0 ] && bad_Usage
+
+# if no action specified, import by default
+( ! $do_import_isos && ! $do_update_settings  ) && do_import_isos=true
+# do not allow import + update
+( $do_import_isos && $do_update_settings ) && bad_Usage
+
+$do_import_isos && import_isos 
+$do_update_settings && update_settings 
 
 # Add management classes if new have being defined.
 add_mgmt_classes


Follow ups