Lines Matching full:machine
28 """Raised when machine does not respond to ping."""
32 """Raised when server fails to lock/unlock machine as requested."""
36 """Raised when user attmepts to unlock machine locked by someone else."""
42 """Enum class to hold machine type."""
76 remotes: A list of machine names or ip addresses to be managed. Names
80 a machine that was locked by someone else.
106 def CheckMachine(self, machine, error_msg): argument
107 """Verifies that machine is responding to ping.
110 machine: String containing the name or ip address of machine to check.
114 MachineNotPingable: If machine is not responding to 'ping'
116 if not machines.MachineIsPingable(machine, logging_level="none"):
117 cros_machine = machine + ".cros"
143 """Get where the machine is located.
146 m: String containing the name or ip address of machine.
162 """Prints status for a single machine.
165 m: String containing the name or ip address of machine.
166 state: A dictionary of the current state of the machine.
167 machine_type: MachineType to determine where the machine is located.
190 def AddMachineToLocal(self, machine): argument
191 """Adds a machine to local machine list.
194 machine: The machine to be added.
196 if machine not in self.local_machines:
197 self.local_machines.append(machine)
199 def AddMachineToCrosfleet(self, machine): argument
200 """Adds a machine to crosfleet machine list.
203 machine: The machine to be added.
205 if machine not in self.crosfleet_machines:
206 self.crosfleet_machines.append(machine)
215 machine_states: A dictionary of the current state of every machine in
225 def UpdateLockInCrosfleet(self, should_lock_machine, machine): argument
226 """Ask crosfleet to lease/release a machine.
229 should_lock_machine: Boolean indicating whether to lock the machine (True)
230 or unlock the machine (False).
231 machine: The machine to update.
238 ret = self.LeaseCrosfleetMachine(machine)
240 ret = self.ReleaseCrosfleetMachine(machine)
245 def UpdateFileLock(self, should_lock_machine, machine): argument
249 should_lock_machine: Boolean indicating whether to lock the machine (True)
250 or unlock the machine (False).
251 machine: The machine to update.
258 ret = file_lock_machine.Machine(machine, self.locks_dir).Lock(
262 ret = file_lock_machine.Machine(machine, self.locks_dir).Unlock(
295 "%s %s machine succeeded: %s."
301 "%s %s machine failed: %s."
308 def _InternalRemoveMachine(self, machine): argument
309 """Remove machine from internal list of machines.
312 machine: Name of machine to be removed from internal list.
314 # Check to see if machine is lab machine and if so, make sure it has
316 cros_machine = machine
317 if machine.find("rack") > 0 and machine.find("row") > 0:
318 if machine.find(".cros") == -1:
322 m for m in self.machines if m not in (cros_machine, machine)
326 """Check that every machine in requested list is in the proper state.
328 If the cmd is 'unlock' verify that every machine is locked by requestor.
329 If the cmd is 'lock' verify that every machine is currently unlocked.
332 machine_states: A dictionary of the current state of every machine in
338 DontOwnLock: The lock on a requested machine is owned by someone else.
344 "Attempt to unlock already unlocked machine "
357 "Attempt to unlock machine (%s) locked by someone "
363 "Attempt to lock already locked machine (%s)" % k
371 dictionary keyed by machine name.
374 cmd: The command for which we are getting the machine states. This is
379 A dictionary of machine states for all the machines in the LockManager
401 def CheckMachineInCrosfleet(self, machine): argument
402 """Run command to check if machine is in Crosfleet or not.
405 True if machine in crosfleet, else False
411 dimensions = "--dimension dut_name=%s" % machine.rstrip(".cros")
421 # The command will return a json output as stdout. If machine not in
431 def LeaseCrosfleetMachine(self, machine): argument
445 machine.rstrip(".cros"),
453 def ReleaseCrosfleetMachine(self, machine): argument
466 machine.rstrip(".cros"),
495 help="Lock given machine(s).",
502 help="Unlock given machine(s).",
509 help="List current status of given machine(s).",