def modify_hosts(host_filter_data, update_data): """ @param host_filter_data: Filters out which hosts to modify. @param update_data: A dictionary with the changes to make to the hosts. """ rpc_utils.check_modify_host(update_data) hosts = models.Host.query_objects(host_filter_data) for host in hosts: host.update_object(update_data)
def modify_host(id, **data): rpc_utils.check_modify_host(data) host = models.Host.smart_get(id) rpc_utils.check_modify_host_locking(host, data) host.update_object(data)