本文整理汇总了Python中disco_aws_automation.DiscoAWS.create_userdata方法的典型用法代码示例。如果您正苦于以下问题:Python DiscoAWS.create_userdata方法的具体用法?Python DiscoAWS.create_userdata怎么用?Python DiscoAWS.create_userdata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类disco_aws_automation.DiscoAWS
的用法示例。
在下文中一共展示了DiscoAWS.create_userdata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_userdata_without_spotinst
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_userdata [as 别名]
def test_create_userdata_without_spotinst(self, **kwargs):
"""
create_userdata doesn't set 'spotinst' key
"""
config_dict = get_default_config_dict()
aws = DiscoAWS(config=get_mock_config(config_dict), environment_name=TEST_ENV_NAME)
user_data = aws.create_userdata(hostclass="mhcunittest", owner="unittestuser", is_spotinst=False)
self.assertEqual(user_data["is_spotinst"], "0")
示例2: test_create_userdata_with_zookeeper
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_userdata [as 别名]
def test_create_userdata_with_zookeeper(self, **kwargs):
"""
create_userdata sets 'zookeepers' key
"""
config_dict = get_default_config_dict()
aws = DiscoAWS(config=get_mock_config(config_dict), environment_name=TEST_ENV_NAME)
user_data = aws.create_userdata(hostclass="mhcunittest", owner="unittestuser")
self.assertEqual(user_data["zookeepers"], "[\\\"mhczookeeper-{}.example.com:2181\\\"]".format(
aws.vpc.environment_name))
示例3: test_create_userdata_with_eip
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_userdata [as 别名]
def test_create_userdata_with_eip(self, **kwargs):
"""
create_userdata sets 'eip' key when an EIP is required
"""
config_dict = get_default_config_dict()
eip = "54.201.250.76"
config_dict["mhcunittest"]["eip"] = eip
aws = DiscoAWS(config=get_mock_config(config_dict), environment_name=TEST_ENV_NAME)
user_data = aws.create_userdata(hostclass="mhcunittest", owner="unittestuser")
self.assertEqual(user_data["eip"], eip)