本文整理汇总了Python中vsc.manage.config.Options.master方法的典型用法代码示例。如果您正苦于以下问题:Python Options.master方法的具体用法?Python Options.master怎么用?Python Options.master使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vsc.manage.config.Options
的用法示例。
在下文中一共展示了Options.master方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testManagerhasSpecials
# 需要导入模块: from vsc.manage.config import Options [as 别名]
# 或者: from vsc.manage.config.Options import master [as 别名]
def testManagerhasSpecials(self):
"""
test on inclusion of special nodes
"""
opts = Options()
opts.cluster = TEST_CLUSTER
manager = Manager(opts)
self.assertFalse(manager.hasSpecials())
opts.worker = True
manager = Manager(opts)
self.assertFalse(manager.hasSpecials())
opts.all_nodes = True
manager = Manager(opts)
self.assertTrue(manager.hasSpecials()) # should have special nodes with force (the master)
opts = Options()
opts.cluster = TEST_CLUSTER
opts.master = "master1"
self.assertTrue(Manager(opts).hasSpecials()) # should create a manager
示例2: testManagerCreatorNodeOptions
# 需要导入模块: from vsc.manage.config import Options [as 别名]
# 或者: from vsc.manage.config.Options import master [as 别名]
def testManagerCreatorNodeOptions(self):
"""
test the manager constructor
"""
# debug = True cluster = None chassis = None down = False all = False
# idle = False offline = False node = ""
opts = Options() # default options object
opts.cluster = TEST_CLUSTER
Manager(opts) # should create a manager
opts.down = True
Manager(opts) # should create a manager
opts.idle = True
Manager(opts) # should create a manager
opts.offline = True
Manager(opts) # should create a manager
opts.master = "master7"
Manager(opts) # should create a manager
示例3: testManagerhasSpecials
# 需要导入模块: from vsc.manage.config import Options [as 别名]
# 或者: from vsc.manage.config.Options import master [as 别名]
def testManagerhasSpecials(self):
"""
test on inclusion of special nodes
"""
opts = Options()
opts.cluster = 'cubone'
manager = Manager(opts)
self.assertFalse(manager.hasSpecials())
opts.worker = True
#self.assertRaises(Exception, Manager, opts)
manager = Manager(opts)
self.assertFalse(manager.hasSpecials())
opts.all_nodes = True
manager = Manager(opts)
self.assertTrue(manager.hasSpecials()) # should have special nodes with force (the master)
opts = Options()
opts.cluster = 'cubone'
opts.master = "master7"
self.assertTrue(Manager(opts).hasSpecials()) # should create a manager