"""
if not machine_type == 'vps':
return True
+ if os_type is None or os_version is None:
+ # we'll use the defaults provided by provision.create_if_vm
+ # later on during provisioning
+ return True
valid_os_and_version = get_distro_from_downburst()
if os_type not in valid_os_and_version:
log.error("os-type '%s' is invalid", os_type)
new machines. This is not called if the one has teuthology-locked
machines and placed those keys in the Targets section of a yaml file.
"""
- os_type = misc.get_distro(ctx)
- os_version = misc.get_distro_version(ctx)
+ # It's OK for os_type and os_version to be None here. If we're trying
+ # to lock a bare metal machine, we'll take whatever is available. If
+ # we want a vps, defaults will be provided by misc.get_distro and
+ # misc.get_distro_version in provision.create_if_vm
+ os_type = ctx.config.get("os_type")
+ os_version = ctx.config.get("os_version")
arch = ctx.config.get('arch')
log.info('Locking machines...')
assert isinstance(config[0], int), 'config[0] must be an integer'