~lutostag/ubuntu/trusty/maas/1.5.4+keystone

« back to all changes in this revision

Viewing changes to scripts/maas-import-isos

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-04-12 16:46:22 UTC
  • mto: (20.1.1 quantal) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20120412164622-laz1qoxycfrddka0
Tags: upstream-0.1+bzr462+dfsg
ImportĀ upstreamĀ versionĀ 0.1+bzr462+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        exit 1
29
29
fi
30
30
 
31
 
distro_info() {
32
 
   # we would like to use distro-info, but cannot (LP: #960142)
33
 
   # if it is there, we will use it. if not, we have a behave-alike
34
 
   # that will need SRUs to get new release knowledge
35
 
   if command -v distro-info >/dev/null; then
36
 
      distro-info "$@"
37
 
      return
38
 
   fi
39
 
 
40
 
   local supported="hardy lucid maverick natty oneiric precise"
41
 
   local devel="precise"
42
 
   local stable="oneiric"
43
 
   [ "$(date +%Y%m%d)" -lt 20120426 ] || stable="precise"
44
 
 
45
 
   case "$1" in
46
 
      --devel) echo "$devel";;
47
 
      --stable) echo "$stable";;
48
 
      --supported) 
49
 
         local d;
50
 
         for d in $supported; do echo "$d"; done
51
 
         ;;
52
 
      *) echo "unknown argument $1"; return 1;;
53
 
   esac
54
 
}
55
 
 
56
31
# Definitions for supported releases and architectures
57
32
[ -r $(pwd)/etc/maas/import_isos ] && . $(pwd)/etc/maas/import_isos
58
33
[ -r /etc/maas/import_isos ] && . /etc/maas/import_isos
59
 
[ -n "$RELEASES" ] || RELEASES=$(distro_info --supported)
 
34
[ -n "$RELEASES" ] || RELEASES=$(distro-info --supported)
60
35
[ -n "$ARCHES" ] || ARCHES="amd64 i386"
61
36
[ -n "$KSDIR" ] || KSDIR="/var/lib/cobbler/kickstarts"
62
37
[ -n "$PRIORITY" ] || PRIORITY="critical"
63
38
[ -n "$LOCALE" ] || LOCALE="en_US"
64
39
[ -n "$INTERFACE" ] || INTERFACE="auto"
65
 
[ -n "$CONSOLE" ] || CONSOLE="ttyS0,9600n8"
66
 
[ -n "$KOPTS" ] || KOPTS="priority=$PRIORITY locale=$LOCALE netcfg/choose_interface=$INTERFACE console=$CONSOLE"
 
40
[ -n "$KOPTS" ] || KOPTS="priority=$PRIORITY locale=$LOCALE netcfg/choose_interface=$INTERFACE"
67
41
[ -n "$ENLIST_PROFILE" ] || ENLIST_PROFILE="maas-enlist"
 
42
[ -n "$IMPORT_EPHEMERALS" ] || IMPORT_EPHEMERALS=1
68
43
if [ -n "$SERVER_IP" ]; then
69
44
        KOPTS="$KOPTS log_host=$SERVER_IP log_port=514"
70
45
else
73
48
                KOPTS="$KOPTS log_host=$SERVER_IP log_port=514"
74
49
        fi
75
50
fi
 
51
if [ -n "$CONSOLE" ]; then
 
52
        KOPTS="$KOPTS console=$CONSOLE"
 
53
fi
76
54
 
77
55
 
78
56
name_arch_in_cobbler_style() {
93
71
                        fi
94
72
                done
95
73
        done
 
74
 
 
75
        [ "$IMPORT_EPHEMERALS" = "0" ] || maas-import-ephemerals --update
96
76
}
97
77
 
98
78
import_isos(){
118
98
                        fi
119
99
                done
120
100
        done
 
101
 
 
102
        [ "${IMPORT_EPHEMERALS}" = "0" ] || maas-import-ephemerals --import
121
103
}
122
104
 
123
105
add_enlist_profile(){
124
 
        STABLE=$(distro_info --stable)
125
 
        DEVEL=$(distro_info --devel)
 
106
        STABLE=$(distro-info --stable)
 
107
        DEVEL=$(distro-info --devel)
126
108
        PARENT_PROFILE=""
127
109
 
128
110
        # Check what release to use as parent profile