• Home
  • Raw
  • Download

Lines Matching full:machine

30   """Raised when machine does not respond to ping."""
34 """Raised when server fails to lock/unlock machine as requested."""
38 """Raised when user attmepts to unlock machine locked by someone else."""
43 """Enum class to hold machine type."""
77 remotes: A list of machine names or ip addresses to be managed. Names
81 a machine that was locked by someone else.
107 def CheckMachine(self, machine, error_msg): argument
108 """Verifies that machine is responding to ping.
111 machine: String containing the name or ip address of machine to check.
115 MachineNotPingable: If machine is not responding to 'ping'
117 if not machines.MachineIsPingable(machine, logging_level='none'):
118 cros_machine = machine + '.cros'
141 """Get where the machine is located.
144 m: String containing the name or ip address of machine.
160 """Prints status for a single machine.
163 m: String containing the name or ip address of machine.
164 state: A dictionary of the current state of the machine.
165 machine_type: MachineType to determine where the machine is located.
176 def AddMachineToLocal(self, machine): argument
177 """Adds a machine to local machine list.
180 machine: The machine to be added.
182 if machine not in self.local_machines:
183 self.local_machines.append(machine)
185 def AddMachineToSkylab(self, machine): argument
186 """Adds a machine to skylab machine list.
189 machine: The machine to be added.
191 if machine not in self.skylab_machines:
192 self.skylab_machines.append(machine)
201 machine_states: A dictionary of the current state of every machine in
211 def UpdateLockInSkylab(self, should_lock_machine, machine): argument
212 """Ask skylab to lease/release a machine.
215 should_lock_machine: Boolean indicating whether to lock the machine (True)
216 or unlock the machine (False).
217 machine: The machine to update.
224 ret = self.LeaseSkylabMachine(machine)
226 ret = self.ReleaseSkylabMachine(machine)
231 def UpdateFileLock(self, should_lock_machine, machine): argument
235 should_lock_machine: Boolean indicating whether to lock the machine (True)
236 or unlock the machine (False).
237 machine: The machine to update.
244 ret = file_lock_machine.Machine(machine, self.locks_dir).Lock(
247 ret = file_lock_machine.Machine(machine, self.locks_dir).Unlock(True)
278 '%s %s machine succeeded: %s.' % (action, machine_type.value, m))
282 '%s %s machine failed: %s.' % (action, machine_type.value, m))
287 def _InternalRemoveMachine(self, machine): argument
288 """Remove machine from internal list of machines.
291 machine: Name of machine to be removed from internal list.
293 # Check to see if machine is lab machine and if so, make sure it has
295 cros_machine = machine
296 if machine.find('rack') > 0 and machine.find('row') > 0:
297 if machine.find('.cros') == -1:
301 m for m in self.machines if m not in (cros_machine, machine)
305 """Check that every machine in requested list is in the proper state.
307 If the cmd is 'unlock' verify that every machine is locked by requestor.
308 If the cmd is 'lock' verify that every machine is currently unlocked.
311 machine_states: A dictionary of the current state of every machine in
317 DontOwnLock: The lock on a requested machine is owned by someone else.
322 self.logger.LogWarning('Attempt to unlock already unlocked machine '
330 raise DontOwnLock('Attempt to unlock machine (%s) locked by someone '
335 'Attempt to lock already locked machine (%s)' % k)
342 dictionary keyed by machine name.
345 cmd: The command for which we are getting the machine states. This is
350 A dictionary of machine states for all the machines in the LockManager
371 def CheckMachineInSkylab(self, machine): argument
372 """Run command to check if machine is in Skylab or not.
375 True if machine in skylab, else False
388 machine.rstrip('.cros')))
394 # The command will return a json output as stdout. If machine not in skylab
404 def LeaseSkylabMachine(self, machine): argument
417 machine.rstrip('.cros')))
424 def ReleaseSkylabMachine(self, machine): argument
436 machine.rstrip('.cros')))
463 help='Lock given machine(s).')
469 help='Unlock given machine(s).')
475 help='List current status of given machine(s).')