Home | History | Annotate | Download | only in cros

Lines Matching refs:hosts

16 locked hosts before the instance is destroyed, it will attempt to unlock() the
17 hosts automatically, but this is to be avoided.
42 """@returns set of locked hosts."""
47 def locked_hosts(self, hosts):
50 @param hosts: a set of strings.
52 self._locked_hosts = hosts
64 # Keep track of hosts locked by this instance.
102 def lock(self, hosts, lock_reason='Locked by HostLockManager'):
103 """Attempt to lock hosts in AFE.
105 @param hosts: a list of strings, host names.
106 @param lock_reason: a string, a reason for locking the hosts.
108 @returns a boolean, True == at least one host from hosts is locked.
110 # Filter out hosts that we may have already locked
111 new_hosts = set(hosts).difference(self._locked_hosts)
119 def unlock(self, hosts=None):
120 """Unlock hosts in AFE.
122 @param hosts: a list of strings, host names.
126 # Filter out hosts that we did not lock
128 if hosts:
129 unknown_hosts = set(hosts).difference(self._locked_hosts)
130 logging.warning('Skip unknown hosts: %s', unknown_hosts)
131 updated_hosts = set(hosts) - unknown_hosts
132 logging.info('Valid hosts: %s', updated_hosts)
138 logging.info('Unlocking hosts: %s', updated_hosts)
142 def _host_modifier(self, hosts, operation, lock_reason=None):
145 @param: hosts, a set of strings, host names.
150 hosts.
153 for host in hosts:
192 @param manager: The HostLockManager used to lock the hosts.