SYSIMG_PATH the path where the system image will be mounted
PARTITIONS dictionary of generic part. types (root/swap)
and their associated devices.
- SUPPORT_FILE_DIR directory on the boot servers containing
- scripts and support files
NODE_ID the id of this machine
Sets the following variables:
if PARTITIONS == None:
raise ValueError, "PARTITIONS"
- SUPPORT_FILE_DIR= vars["SUPPORT_FILE_DIR"]
- if SUPPORT_FILE_DIR == None:
- raise ValueError, "SUPPORT_FILE_DIR"
-
NODE_ID= vars["NODE_ID"]
if NODE_ID == "":
raise ValueError, "NODE_ID"
vars['ROOT_MOUNTED']= 1
- # check deployment (if it's alpha?)
- deployment = ""
+ # fetch deployment tag (like, 'alpha' or the like)
try:
- node_tag_ids = BootAPI.call_api_function(vars, "GetNodes", (NODE_ID,))[0]['node_tag_ids']
- node_tags = BootAPI.call_api_function(vars, "GetNodeTags", (node_tag_ids,))
- deployment_tag = [x for x in node_tags if x['tagname'] == 'deployment']
- if deployment_tag:
- deployment = deployment_tag[0]['value']
+ deployment = BootAPI.call_api_function(vars, "GetNodeDeployment", (NODE_ID,) )
except:
log.write("WARNING : Failed to query tag 'deployment'\n")
- log.write(traceback.format_exc())
+ deployment = ""
# which extensions are we part of ?
utils.breakpoint("Checking for the extension(s) tags")
log.write ("Using nodefamily=%s-%s\n"%(pldistro,arch))
- bootstrapfs_names = [ pldistro ] + extensions
+ # deployment is enough, let operators put what they want in there
+ if deployment:
+ bootstrapfs_names = [ deployment ]
+ else:
+ bootstrapfs_names = [ "%s-%s"%(x,arch) for x in [ pldistro ] + extensions ]
# download and extract support tarball for this step, which has
# everything we need to successfully run
- # we first try to find a tarball, if it is not found we use yum instead
+ # installing extensions through yum has been dismantled
yum_extensions = []
# download and extract support tarball for this step,
- for bootstrapfs_name in bootstrapfs_names:
- tarball = "bootstrapfs-%s-%s%s"%(bootstrapfs_name,arch,download_suffix)
- if len(deployment):
- # we keep bootstrapfs tarballs for deployments in a
- # sub-folder, but with same filenames
- tarball = "%s/%s" %(deployment, tarball)
- source_file= "%s/%s" % (SUPPORT_FILE_DIR,tarball)
- dest_file= "%s/%s" % (SYSIMG_PATH, os.path.basename(tarball))
+ for name in bootstrapfs_names:
+ tarball = "bootstrapfs-%s%s"%(name,download_suffix)
+ source_file= "/boot/%s" % (SUPPORT_FILE_DIR,tarball)
+ dest_file= "%s/%s" % (SYSIMG_PATH, tarball)
# 30 is the connect timeout, 14400 is the max transfer time in
# seconds (4 hours)
utils.removefile( dest_file )
else:
# the main tarball is required
- if bootstrapfs_name == pldistro:
+ if name == "%s-%s"%(pldistro,arch):
raise BootManagerException, "Unable to download main tarball %s from server." % \
source_file
else:
- log.write("tarball for %s-%s not found, scheduling a yum attempt\n"%(bootstrapfs_name,arch))
- yum_extensions.append(bootstrapfs_name)
+ log.write("tarball for %s not found, scheduling a yum attempt\n"%(name))
+ yum_extensions.append(name)
# copy resolv.conf from the base system into our temp dir
# so DNS lookups work correctly while we are chrooted