本文整理汇总了Python中grid_control.datasets.DataProvider.resyncSources方法的典型用法代码示例。如果您正苦于以下问题:Python DataProvider.resyncSources方法的具体用法?Python DataProvider.resyncSources怎么用?Python DataProvider.resyncSources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grid_control.datasets.DataProvider
的用法示例。
在下文中一共展示了DataProvider.resyncSources方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: jobs_reset_attempts
# 需要导入模块: from grid_control.datasets import DataProvider [as 别名]
# 或者: from grid_control.datasets.DataProvider import resyncSources [as 别名]
if opts.job_reset_attempts:
jobs_reset_attempts(jobDB, selected)
if opts.job_force_state:
jobs_force_state(opts, jobDB, selected)
if opts.job_show_jdl:
jobs_show_jdl(jobDB, selected)
########################################################
# DATASET INFOS
if opts.dataset_show_diff:
if len(args) != 2:
utils.exitWithUsage('%s <dataset source 1> <dataset source 2>' % sys.argv[0])
a = DataProvider.createInstance('ListProvider', config, args[0], None)
b = DataProvider.createInstance('ListProvider', config, args[1], None)
(blocksAdded, blocksMissing, blocksChanged) = DataProvider.resyncSources(a.getBlocks(show_stats = False), b.getBlocks(show_stats = False))
utils.printTabular([(DataProvider.Dataset, 'Dataset'), (DataProvider.BlockName, 'Block')], blocksMissing)
if opts.dataset_show_removed:
if len(args) < 2:
utils.exitWithUsage('%s <dataset source 1> <dataset source 2> ... <dataset source N> ' % sys.argv[0])
removed = []
oldDP = DataProvider.createInstance('ListProvider', config, args[0], None)
for new in args[1:]:
newDP = DataProvider.createInstance('ListProvider', config, new, None)
(blocksAdded, blocksMissing, blocksChanged) = DataProvider.resyncSources(oldDP.getBlocks(show_stats = False), newDP.getBlocks(show_stats = False))
for block in blocksMissing:
tmp = dict(block)
tmp[-1] = new
removed.append(tmp)
oldDP = newDP
示例2: jobs_reset_attempts
# 需要导入模块: from grid_control.datasets import DataProvider [as 别名]
# 或者: from grid_control.datasets.DataProvider import resyncSources [as 别名]
jobs_reset_attempts(jobDB, selected)
if opts.job_force_state:
jobs_force_state(opts, jobDB, selected)
if opts.job_show_jdl:
jobs_show_jdl(jobDB, selected)
########################################################
# DATASET INFOS
if opts.dataset_show_diff:
if len(args) != 2:
utils.exitWithUsage('%s <dataset source 1> <dataset source 2>' % sys.argv[0])
utils.eprint = lambda *x: {}
a = DataProvider.createInstance('ListProvider', config, args[0], None)
b = DataProvider.createInstance('ListProvider', config, args[1], None)
(blocksAdded, blocksMissing, blocksChanged) = DataProvider.resyncSources(a.getBlocks(), b.getBlocks())
utils.printTabular([(DataProvider.Dataset, 'Dataset'), (DataProvider.BlockName, 'Block')], blocksMissing)
if opts.dataset_show_removed:
if len(args) < 2:
utils.exitWithUsage('%s <dataset source 1> <dataset source 2> ... <dataset source N> ' % sys.argv[0])
removed = []
utils.eprint = lambda *x: {}
oldDP = DataProvider.createInstance('ListProvider', config, args[0], None)
for new in args[1:]:
newDP = DataProvider.createInstance('ListProvider', config, new, None)
(blocksAdded, blocksMissing, blocksChanged) = DataProvider.resyncSources(oldDP.getBlocks(), newDP.getBlocks())
for block in blocksMissing:
tmp = dict(block)
tmp[-1] = new
removed.append(tmp)