- # check if the plain-bootstrapfs tag is set
- download_suffix=".tar.bz2"
- untar_option="-j"
- try:
- if BootAPI.call_api_function (vars, "GetNodePlainBootstrapfs", (NODE_ID,) ):
- download_suffix=".tar"
- untar_option=""
- except:
- log.write("WARNING : Failed to query tag 'plain-bootstrapfs'\n")
- log.write(traceback.format_exc())
-
- if not untar_option:
- log.write("Using uncompressed bootstrapfs images\n")
-
- # see also GetBootMedium in PLCAPI that does similar things
- # figuring the default node family:
- # (1) get node's tags 'arch' and 'pldistro'
- # (2) if unsuccessful search /etc/planetlab/nodefamily on the bootcd
- # (3) if that fails, set to planetlab-i386
-
- try:
- api_pldistro = BootAPI.call_api_function(vars, "GetNodePldistro", (NODE_ID,) )
- except:
- log.write("WARNING : Failed to query tag 'pldistro'\n")
- api_pldistro = None
- try:
- api_arch = BootAPI.call_api_function(vars, "GetNodeArch", (NODE_ID,) )
- except:
- log.write("WARNING : Failed to query tag 'arch'\n")
- api_arch = None
- try:
- (etc_pldistro,etc_arch) = file("/etc/planetlab/nodefamily").read().strip().split("-")
- except:
- log.write("WARNING : Failed to parse /etc/planetlab/nodefamily\n")
- (etc_pldistro,etc_arch)=(None,None)
- default_pldistro="planetlab"
- default_arch="i386"
-
- if api_pldistro:
- pldistro = api_pldistro
- log.write ("Using pldistro from pldistro API tag\n")
- elif etc_pldistro:
- pldistro = etc_pldistro
- log.write ("Using pldistro from /etc/planetlab/nodefamily\n")
- else:
- pldistro = default_pldistro
- log.write ("Using default pldistro\n")
-
- if api_arch:
- arch = api_arch
- log.write ("Using arch from arch API tag\n")
- elif etc_arch:
- arch = etc_arch
- log.write ("Using arch from /etc/planetlab/nodefamily\n")