本文整理汇总了Python中machine.Machine.status方法的典型用法代码示例。如果您正苦于以下问题:Python Machine.status方法的具体用法?Python Machine.status怎么用?Python Machine.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machine.Machine
的用法示例。
在下文中一共展示了Machine.status方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import status [as 别名]
def __init__(self, vm_limit, azure_config, skip_setup, local):
self.vm_limit = vm_limit # user input
self.budget = 0
self.timestamp = datetime.now()
self.cost_pred = 0
self.wf_end = None
self.jobs_terminated = False
self.last_resched = None
self.workflow = Workflow()
self.logwatcher = LogWatcher()
self.schedule = Schedule()
manager = Machine()
manager.status = MachineStatus.manager
manager.condor_slot = 'manager'
self.machines = [manager]
boot_entry = ScheduleEntry(Job('boot', None), manager, self.timestamp, self.timestamp)
boot_entry.real_start = self.timestamp
boot_entry.real_end = self.timestamp
boot_entry.status = EntryStatus.completed
self.schedule.add_entry_host(boot_entry, manager)
self.local = local
if azure_config and not local:
hostname = socket.gethostname()
self.exp = AzureExperiment(azure_config, skip_setup=skip_setup, name=hostname)
self.master_addr = socket.gethostbyname(hostname)
self.user = azure_config.admin_username
else:
self.exp = self.master_addr = self.user = None
示例2: sync_machines
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import status [as 别名]
def sync_machines(self):
slots = condor_slots()
for s in slots:
if s not in [m.condor_slot for m in self.machines]:
machine = Machine()
machine.status = MachineStatus.running
machine.condor_slot = s
boot_job = Job('boot', None)
boot_entry = ScheduleEntry(boot_job, machine, None, None)
boot_entry.log[LogKey.real_start] = self.creation_timestamp
boot_entry.log[LogKey.real_end] = self.timestamp
boot_entry.status = EntryStatus.completed
self.entries.append(boot_entry)
self.machines.append(machine)
print "++Machine", s
示例3: __init__
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import status [as 别名]
def __init__(self):
self.workflow = Workflow()
self.creation_timestamp = self.timestamp = datetime.now()
self.logwatcher = LogWatcher()
manager = Machine()
manager.status = MachineStatus.manager
manager.condor_slot = 'local'
self.machines = [manager]
boot_entry = ScheduleEntry(Job('boot', None), manager, None, None)
boot_entry.real_start = self.timestamp
boot_entry.real_end = self.timestamp
boot_entry.status = EntryStatus.completed
self.entries = [boot_entry]
self.entries_cid = {}