teuthology.lock package

Submodules

teuthology.lock.cli module

teuthology.lock.cli.do_summary(ctx)
teuthology.lock.cli.main(ctx)
teuthology.lock.cli.updatekeys(args)

teuthology.lock.ops module

teuthology.lock.ops.do_update_keys(machines, all_=False, _raise=True)
teuthology.lock.ops.lock_many(ctx, num, machine_type, user=None, description=None, os_type=None, os_version=None, arch=None)
teuthology.lock.ops.lock_many_openstack(ctx, num, machine_type, user=None, description=None, arch=None)
teuthology.lock.ops.lock_one(name, user=None, description=None)
teuthology.lock.ops.push_new_keys(keys_dict, reference)
teuthology.lock.ops.unlock_many(names, user)
teuthology.lock.ops.unlock_one(ctx, name, user, description=None)
teuthology.lock.ops.update_inventory(node_dict)

Like update_lock(), but takes a dict and doesn’t try to do anything smart by itself

teuthology.lock.ops.update_lock(name, description=None, status=None, ssh_pub_key=None)
teuthology.lock.ops.update_nodes(nodes, reset_os=False)

teuthology.lock.query module

teuthology.lock.query.find_stale_locks(owner=None)

Return a list of node dicts corresponding to nodes that were locked to run a job, but the job is no longer running. The purpose of this is to enable us to nuke nodes that were left locked due to e.g. infrastructure failures and return them to the pool.

Parameters:owner – If non-None, return nodes locked by owner. Default is None.
teuthology.lock.query.get_status(name)
teuthology.lock.query.get_statuses(machines)
teuthology.lock.query.is_vm(name=None, status=None)
teuthology.lock.query.list_locks(keyed_by_name=False, **kwargs)

teuthology.lock.util module

teuthology.lock.util.json_matching_statuses(json_file_or_str, statuses)

Filter statuses by json dict in file or fragment; return list of matching statuses. json_file_or_str must be a file containing json or json in a string.

teuthology.lock.util.locked_since_seconds(node)
teuthology.lock.util.validate_distro_version(version, supported_versions)

Return True if the version is valid. For Ubuntu, possible supported version values are of the form ‘12.04 (precise)’ where either the number of the version name is acceptable.

teuthology.lock.util.vps_version_or_type_valid(machine_type, os_type, os_version)

Check os-type and os-version parameters when locking a vps. Os-type will always be set (defaults to ubuntu).

In the case where downburst does not handle list-json (an older version of downburst, for instance), a message is printed and this checking is skipped (so that this code should behave as it did before this check was added).

teuthology.lock.util.winnow(statuses, arg, status_key, func=None)

Call with a list of statuses, and the ctx.<key> ‘arg’ that you may want to filter by. If arg is not None, filter statuses by either:

1) func=None: filter by status[status_key] == arg remove any status that fails

2) func=<filter function that takes status>: remove any status for which func returns False

Return the possibly-smaller set of statuses.

Module contents