本文整理汇总了Python中userinterface.Client.getCloudSpecs方法的典型用法代码示例。如果您正苦于以下问题:Python Client.getCloudSpecs方法的具体用法?Python Client.getCloudSpecs怎么用?Python Client.getCloudSpecs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类userinterface.Client
的用法示例。
在下文中一共展示了Client.getCloudSpecs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getPandaStatus
# 需要导入模块: from userinterface import Client [as 别名]
# 或者: from userinterface.Client import getCloudSpecs [as 别名]
def getPandaStatus(self):
for country in self.config.sites.keys():
for group in self.config.sites[country].keys():
# country/group = None is equivalent to not specifing anything
self.factoryMessages.info('Polling panda status for country=%s, group=%s' % (country, group,))
error,self.config.sites[country][group]['siteStatus'] = Client.getJobStatisticsPerSite(countryGroup=country,workingGroup=group)
if error != 0:
raise PandaStatusFailure, 'Client.getJobStatisticsPerSite(countryGroup=%s,workingGroup=%s) error: %s' % (country, group, error)
for siteid, queues in self.config.sites[country][group].iteritems():
if siteid == 'siteStatus':
continue
if siteid in self.config.sites[country][group]['siteStatus']:
self.factoryMessages.debug('Panda status: %s (country=%s, group=%s) %s' % (siteid, country, group, self.config.sites[country][group]['siteStatus'][siteid]))
for queue in queues:
self.config.queues[queue]['pandaStatus'] = self.config.sites[country][group]['siteStatus'][siteid]
else:
# If panda knows nothing, then we assume all zeros (site may be inactive)
self.factoryMessages.debug('Panda status for siteid %s (country=%s, group=%s) not found - setting zeros in status to allow bootstraping of site.' % (siteid, country, group))
for queue in queues:
self.config.queues[queue]['pandaStatus'] = {'transferring': 0, 'activated': 0, 'running': 0, 'assigned': 0, 'failed': 0, 'finished': 0}
# Now poll site and cloud status to suppress pilots if a site is offline
# Take site staus out - better to use individual queue status from schedconfig
#self.factoryMessages.info('Polling panda for site status')
#error,self.pandaSiteStatus = Client.getSiteSpecs(siteType='all')
#if error != 0:
# raise PandaStatusFailure, '''Client.getSiteSpecs(siteType='all') error: %s''' % (error)
self.factoryMessages.info('Polling panda for cloud status')
error,self.pandaCloudStatus = Client.getCloudSpecs()
if error != 0:
raise PandaStatusFailure, 'Client.getCloudSpecs() error: %s' % (error)