• Home
  • Raw
  • Download

Lines Matching full:hosts

13 When specifying foreign key fields (i.e. adding hosts to a label, or adding
123 # Hosts that have the label to be deleted. Save this info before
125 hosts = []
127 hosts.append(models.Host.smart_get(h.id))
132 rpc_utils.fanout_rpc(hosts, 'delete_label', False, id=id)
165 def add_label_to_hosts(id, hosts): argument
166 """Adds a label of the given id to the given hosts only in local DB.
169 @param hosts: The hostnames of hosts that need the label.
177 host_objs = models.Host.smart_get_bulk(hosts)
186 def _create_label_everywhere(id, hosts): argument
196 the label but also tells the shards that service the hosts to also
200 @param hosts: A list of hostnames or ids. More often hostnames.
218 # we are adding a new label only to shards of hosts that the label
222 # Later, when we add the same label L1 to hosts in shards S1 and S2,
226 host_objs = models.Host.smart_get_bulk(hosts)
234 def label_add_hosts(id, hosts): argument
235 """Adds a label with the given id to the given hosts.
242 @param hosts: A list of hostnames or ids. More often hostnames.
248 _create_label_everywhere(id, hosts)
251 add_label_to_hosts(id, hosts)
254 host_objs = models.Host.smart_get_bulk(hosts)
258 def remove_label_from_hosts(id, hosts): argument
259 """Removes a label of the given id from the given hosts only in local DB.
262 @param hosts: The hostnames of hosts that need to remove the label from.
264 host_objs = models.Host.smart_get_bulk(hosts)
268 'Failed to remove label "%s" for hosts "%r" because it is a '
270 'modify this label.' % (label.name, hosts))
276 def label_remove_hosts(id, hosts): argument
277 """Removes a label of the given id from the given hosts.
282 @param hosts: A list of hostnames or ids. More often hostnames.
284 host_objs = models.Host.smart_get_bulk(hosts)
285 remove_label_from_hosts(id, hosts)
327 # hosts
394 """Modify local attributes of multiple hosts.
396 If this is called on the main, but one of the hosts in that match the
413 @param host_filter_data: Filters out which hosts to modify.
414 @param update_data: A dictionary with the changes to make to the hosts.
418 hosts = models.Host.query_objects(host_filter_data)
423 # Check all hosts before changing data for exception safety.
424 for host in hosts:
441 for host in hosts:
453 """Modify attributes of hosts in local DB.
455 @param host_filter_data: Filters out which hosts to modify.
456 @param update_data: A dictionary with the changes to make to the hosts.
549 @param host_filter_data: filter data to apply to Hosts to choose hosts to
552 hosts = rpc_utils.get_host_query((), False, True, host_filter_data)
553 hosts = list(hosts)
554 models.Host.objects.populate_relationships(hosts, models.HostAttribute,
558 for host_obj in hosts:
576 """Set an attribute on hosts.
582 @param host_filter_data: filter data to apply to Hosts to choose hosts to
590 """Set an attribute on hosts.
598 @param host_filter_data: filter data to apply to Hosts to choose hosts to
601 assert host_filter_data # disallow accidental actions on all hosts
602 hosts = models.Host.query_objects(host_filter_data)
603 models.AclGroup.check_for_acl_violation_hosts(hosts)
604 for host in hosts:
609 rpc_utils.fanout_rpc(hosts, 'set_host_attribute_impl', False,
620 """Get a list of dictionaries which contains the information of hosts.
622 @param multiple_labels: match hosts in all of the labels given. Should
631 hosts = rpc_utils.get_host_query(multiple_labels,
634 hosts = list(hosts)
635 models.Host.objects.populate_relationships(hosts, models.Label,
637 models.Host.objects.populate_relationships(hosts, models.AclGroup,
639 models.Host.objects.populate_relationships(hosts, models.HostAttribute,
641 models.Host.objects.populate_relationships(hosts,
645 for host_obj in hosts:
699 @returns The number of matching hosts.
704 hosts = rpc_utils.get_host_query(multiple_labels,
707 return len(hosts)
806 def acl_group_add_hosts(id, hosts): argument
809 hosts = models.Host.smart_get_bulk(hosts)
810 group.hosts.add(*hosts)
814 def acl_group_remove_hosts(id, hosts): argument
817 hosts = models.Host.smart_get_bulk(hosts)
818 group.hosts.remove(*hosts)
832 acl_group['hosts'] = [host.hostname
833 for host in acl_group_obj.hosts.all()]
926 # When cloning a job, hosts and meta_hosts should not exist together,
929 if kwargs.get('hosts') and kwargs.get('meta_hosts'):
962 hosts=(), argument
1010 @param hosts List of hosts to run job on.
1013 @param one_time_hosts List of hosts not in the database to run the job on.
1039 hosts=hosts,
1094 def _call_special_tasks_on_hosts(task, hosts): argument
1096 Schedules a set of hosts for a special task.
1100 models.AclGroup.check_for_acl_violation_hosts(hosts)
1101 shard_host_map = rpc_utils.bucket_hosts_by_shard(hosts)
1103 raise ValueError('The following hosts are on shards, please '
1106 for host in hosts:
1108 return list(sorted(host.hostname for host in hosts))
1114 For main, when special tasks are fired on hosts that are sharded,
1125 hosts = models.Host.query_objects(filter_data)
1126 shard_host_map = rpc_utils.bucket_hosts_by_shard(hosts)
1128 # Filter out hosts on a shard from those on the main, forward
1132 hosts = [h for h in hosts if h.shard is None]
1137 # the 'hostname' filter should narrow down the list of hosts on
1148 # hosts before we create the task. The host will stay on the main if:
1154 # Given that we only rarely verify Ready hosts it isn't worth putting this
1159 return _call_special_tasks_on_hosts(task, hosts)
1164 Schedules a set of hosts for verify.
1174 Schedules a set of hosts for repair.
1188 all hosts have completed.
1189 -finished: Include only jobs for which all hosts have completed (or
1241 of hosts currently with that status, i.e. {'Queued' : 4, 'Running' : 2}.
1268 for host in job_info['hosts']:
1289 hosts=host_dicts)
1727 "Pending": "Waiting on other hosts",
1738 "Resetting": "Resetting hosts"}
1762 Get the list of valid hosts that share the same host attribute value.
1765 @param value: String of the value that is shared between hosts.
1774 # Add hosts:
1789 # Add hosts:
1869 @param check_hosts: require appropriate live hosts to exist in the lab.
2012 as the hosts run the job and the special tasks executed before
2022 """Receive updates for job statuses from shards and assign hosts and jobs.
2031 @param known_host_ids: List of ids of hosts the shard already has.
2032 @param known_host_statuses: List of statuses of hosts the shard already has.
2034 @returns: Serialized representations of hosts, jobs, suite job keyvals
2043 # This is not true for hosts though: A host that is leased won't be sent
2045 # sometimes hosts should be transfered that have a lower id than the
2047 # 2. Send the number of jobs/hosts the shard knows to the main in each
2051 # This would work well for hosts, because there aren't that many.
2055 # 3. Mixtures of the above: Use 1 for jobs and 2 for hosts.
2078 hosts, jobs, suite_keyvals, inc_ids = rpc_utils.find_records_for_shard(
2082 'hosts': [host.serialize() for host in hosts],
2213 This claims back all assigned hosts from the shard.