- log.write("WARNING : Failed to query nodegroups - installing only core software\n")
- nodegroupnames = []
- pass
-
- # see also GetBootMedium in PLCAPI that does similar things
- # figuring the default node family:
- # (1) look at /etc/planetlab/nodefamily on the bootcd
- # (2) otherwise use GetPlcRelease()
- # (3) if everything else fails, set to planetlab-i386
- try:
- (pldistro,arch) = file("/etc/planetlab/nodefamily").read().split("-")
- except:
- # fetch the pldistro our myplc was built upon
- try:
- plc_release = BootAPI.call_api_function (vars, "GetPlcRelease",())
- pldistro = plc_release ['build']['planetlab-distro']
- arch = plc_release ['build']['target-arch']
- except:
- (pldistro,arch) = ("planetlab","i386")
-
- # scan nodegroupnames - temporary, as most of this nodegroup-based info
- # should be more adequately defined in the nodes data model
- known_archs = [ 'i386', 'x86_64' ]
- extensions = []
- # (1) if groupname == arch, nodefamily becomes pldistro-groupname
- # (2) else if groupname looks like pldistro-arch, it is taken as a nodefamily
- # (3) otherwise groupname is taken as an extension
- for nodegroupname in nodegroupnames:
- if nodegroupname in known_archs:
- arch = nodegroupname
- else:
- is_nodefamily = False
- for known_arch in known_archs:
- try:
- (api_pldistro,api_arch)=nodegroupname.split("-")
- # sanity check
- if api_arch != known_arch: raise Exception,"mismatch"
- (pldistro,arch) = (api_pldistro, api_arch)
- is_nodefamily = True
- break
- except:
- pass
- if not is_nodefamily:
- extensions.append(nodegroupname)
-
- bootstrapfs_names = [ pldistro ] + extensions
-
- # download and extract support tarball for this step, which has
- # everything we need to successfully run
+ raise BootManagerException ("Could not call GetNodeFlavour - need PLCAPI-5.0")
+
+ # the 'plain' option is for tests mostly
+ if plain:
+ download_suffix=".tar"
+ uncompress_option=""
+ log.write("Using plain bootstrapfs images\n")
+ else:
+ download_suffix=".tar.bz2"
+ uncompress_option="-j"
+ log.write("Using compressed bootstrapfs images\n")
+
+ log.write ("Using nodefamily=%s\n"%(nodefamily))
+ if not extensions:
+ log.write("Installing only core software\n")
+ else:
+ log.write("Requested extensions %r\n" % extensions)
+
+ bootstrapfs_names = [ nodefamily ] + extensions