Home | History | Annotate | Download | only in hosts

Lines Matching refs:host

19     We'll check if the label already exists on the host and return True if so.
20 Otherwise we'll check if the label should exist on the host.
24 def exists_wrapper(self, host):
29 @param host: The host object to run methods on.
31 @returns True if the label already exists on the host, otherwise run
34 info = host.host_info_store.get()
35 return (self._NAME in info.labels) or exists(self, host)
41 This class contains the scaffolding for the host-specific labels.
64 def generate_labels(self, host):
66 Return the list of labels generated for the host.
68 @param host: The host object to check on. Not needed here for base case
71 @return a list of labels applicable to the host.
76 def exists(self, host):
78 Checks the host if the label is applicable or not.
80 This method is geared for the type of labels that indicate if the host
83 host or not.
85 @param host: The host object to check on.
90 def get(self, host):
94 @param host: The host object to check on.
96 if self.exists(host):
97 return self.generate_labels(host)
134 def generate_labels(self, host):
138 def exists(self, host):
148 present and indicate the os/board/etc type of the host. The _NAME property
159 def get(self, host):
162 @param host: The host object to check on.
164 if self.exists(host):
166 for label in self.generate_labels(host)]
189 """This class will assist in retrieving/updating the host labels."""
212 def get_labels(self, host):
214 Retrieve the labels for the host.
216 @param host: The host to get the labels for.
222 labels.extend(label.get(host))
235 want to keep but won't be part of the new labels detected on the host.
248 def update_labels(self, host):
250 Retrieve the labels from the host and update if needed.
252 @param host: The host to update the labels for.
259 old_labels = set(host._afe_host.labels)
263 new_labels = set(self.get_labels(host))
270 afe.run('host_remove_labels', id=host.hostname,
277 afe.run('host_add_labels', id=host.hostname, labels=labels_to_add)