← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~smoser/maas/lp960142 into lp:maas

 

Scott Moser has proposed merging lp:~smoser/maas/lp960142 into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #960142 in MAAS: "maas-import-isos uses distro-info without dependency"
  https://bugs.launchpad.net/maas/+bug/960142

For more details, see:
https://code.launchpad.net/~smoser/maas/lp960142/+merge/98510

Add a distro-info workalike to remove the dependency on distro-info, since we cannot have that in main.

-- 
https://code.launchpad.net/~smoser/maas/lp960142/+merge/98510
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~smoser/maas/lp960142 into lp:maas.
=== modified file 'scripts/maas-import-isos'
--- scripts/maas-import-isos	2012-03-19 03:14:40 +0000
+++ scripts/maas-import-isos	2012-03-20 20:28:24 +0000
@@ -28,10 +28,35 @@
 	exit 1
 fi
 
+distro_info() {
+   # we would like to use distro-info, but cannot (LP: #960142)
+   # if it is there, we will use it. if not, we have a behave-alike
+   # that will need SRUs to get new release knowledge
+   if command -v distro-info >/dev/null; then
+      distro-info "$@"
+      return
+   fi
+
+   local supported="hardy lucid maverick natty oneiric precise"
+   local devel="precise"
+   local stable="oneiric"
+   [ "$(date +%Y%m%d)" -lt 20120426 ] || stable="precise"
+
+   case "$1" in
+      --devel) echo "$devel";;
+      --stable) echo "$stable";;
+      --supported) 
+         local d;
+         for d in $supported; do echo "$d"; done
+         ;;
+      *) echo "unknown argument $1"; return 1;;
+   esac
+}
+
 # Definitions for supported releases and architectures
 [ -r $(pwd)/etc/maas/import_isos ] && . $(pwd)/etc/maas/import_isos
 [ -r /etc/maas/import_isos ] && . /etc/maas/import_isos
-[ -n "$RELEASES" ] || RELEASES=$(distro-info --supported)
+[ -n "$RELEASES" ] || RELEASES=$(distro_info --supported)
 [ -n "$ARCHES" ] || ARCHES="amd64 i386"
 [ -n "$KSDIR" ] || KSDIR="/var/lib/cobbler/kickstarts"
 [ -n "$PRIORITY" ] || PRIORITY="critical"
@@ -95,8 +120,8 @@
 }
 
 add_enlist_profile(){
-        STABLE=$(distro-info --stable)
-        DEVEL=$(distro-info --devel)
+        STABLE=$(distro_info --stable)
+        DEVEL=$(distro_info --devel)
         PARENT_PROFILE=""
 
         # Check what release to use as parent profile


Follow ups