Lines Matching full: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): argument
50 @param hosts: a set of strings.
52 self._locked_hosts = hosts
60 # Keep track of hosts locked by this instance.
101 def lock(self, hosts, lock_reason='Locked by HostLockManager'): argument
102 """Lock hosts in datastore.
104 @param hosts: a list of strings, host names.
105 @param lock_reason: a string, a reason for locking the hosts.
107 @returns a boolean, True == at least one host from hosts is locked.
109 # Filter out hosts that we may have already locked
110 new_hosts = set(hosts).difference(self._locked_hosts)
118 def unlock(self, hosts=None): argument
119 """Unlock hosts in datastore after use.
121 @param hosts: a list of strings, host names.
125 # Filter out hosts that we did not lock
127 if hosts:
128 unknown_hosts = set(hosts).difference(self._locked_hosts)
129 logging.warning('Skip unknown hosts: %s', unknown_hosts)
130 updated_hosts = set(hosts) - unknown_hosts
131 logging.info('Valid hosts: %s', updated_hosts)
137 logging.info('Unlocking hosts (APs / PCAPs): %s', updated_hosts)
141 def _host_modifier(self, hosts, operation, lock_reason=None): argument
142 """Helper that locks hosts in DataStore.
144 @param: hosts, a set of strings, host names.
149 hosts.
152 for host in hosts:
195 @param manager: The HostLockManager used to lock the hosts.