本文整理匯總了Python中cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver.get_stack_order方法的典型用法代碼示例。如果您正苦於以下問題:Python DependencyResolver.get_stack_order方法的具體用法?Python DependencyResolver.get_stack_order怎麽用?Python DependencyResolver.get_stack_order使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver
的用法示例。
在下文中一共展示了DependencyResolver.get_stack_order方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_stack_order_raises_exception_on_cyclic_dependency
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_raises_exception_on_cyclic_dependency(self):
stacks = {
'app1': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': '|Ref|app2.id'}}),
'app2': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': '|Ref|app3.id'}}),
'app3': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': '|Ref|app1.id'}})
}
with self.assertRaises(CyclicDependencyException):
DependencyResolver.get_stack_order(stacks)
示例2: test_get_stack_order_raises_exception_on_cyclic_dependency
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_raises_exception_on_cyclic_dependency(self):
stacks = {
"app1": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|app2.id"}}),
"app2": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|app3.id"}}),
"app3": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|app1.id"}}),
}
with self.assertRaises(CyclicDependencyException):
DependencyResolver.get_stack_order(stacks)
示例3: test_get_stack_order_accepts_stacks_without_parameters_key
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_accepts_stacks_without_parameters_key(self):
stacks = {'default-sg': {},
'app1': None,
'app2': {},
'vpc': {},
}
result = 4
self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
示例4: test_get_stack_order_includes_independent_stacks
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_includes_independent_stacks(self):
stacks = {'default-sg': StackConfig({'template-url': 'horst.yml'}),
'app1': StackConfig(
{'template-url': 'horst.yml', 'parameters': {'a': '|Ref|vpc.id', 'b': '|Ref|default-sg.id'}}),
'app2': StackConfig({'template-url': 'horst.yml',
'parameters': {'a': '|Ref|vpc.id', 'b': '|Ref|default-sg.id',
'c': 'Ref::app1.id'}}),
'vpc': StackConfig({'template-url': 'horst.yml',
'parameters': {'logBucketName': 'is24-cloudtrail-logs',
'includeGlobalServices': False}})
}
result = 4
self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
示例5: test_get_stack_order_returns_a_valid_order_from_ref_in_list
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_returns_a_valid_order_from_ref_in_list(self):
stacks = {'default-sg': StackConfig({'template-url': 'horst.yml', 'parameters': {'a': ['|Ref|vpc.id']}}),
'app1': StackConfig(
{'template-url': 'horst.yml', 'parameters': {'a': ['|Ref|vpc.id'], 'b': ['|Ref|default-sg.id']}}),
'app2': StackConfig({'template-url': 'horst.yml',
'parameters': {'a': ['|Ref|vpc.id'], 'b': ['|Ref|default-sg.id'],
'c': ['|Ref|app1.id']}}),
'vpc': StackConfig({'template-url': 'horst.yml',
'parameters': {'logBucketName': 'is24-cloudtrail-logs',
'includeGlobalServices': False}})
}
expected = ['vpc', 'default-sg', 'app1', 'app2']
self.assertEqual(expected, DependencyResolver.get_stack_order(stacks))
示例6: test_get_stack_order_includes_independent_stacks
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_includes_independent_stacks(self):
stacks = {
"default-sg": StackConfig({"template-url": "horst.yml"}),
"app1": StackConfig(
{"template-url": "horst.yml", "parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id"}}
),
"app2": StackConfig(
{
"template-url": "horst.yml",
"parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id", "c": "Ref::app1.id"},
}
),
"vpc": StackConfig(
{
"template-url": "horst.yml",
"parameters": {"logBucketName": "is24-cloudtrail-logs", "includeGlobalServices": False},
}
),
}
result = 4
self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))
示例7: test_get_stack_order_returns_a_valid_order
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_returns_a_valid_order(self):
stacks = {
"default-sg": StackConfig({"template-url": "horst.yml", "parameters": {"a": "|Ref|vpc.id"}}),
"app1": StackConfig(
{"template-url": "horst.yml", "parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id"}}
),
"app2": StackConfig(
{
"template-url": "horst.yml",
"parameters": {"a": "|Ref|vpc.id", "b": "|Ref|default-sg.id", "c": "|Ref|app1.id"},
}
),
"vpc": StackConfig(
{
"template-url": "horst.yml",
"parameters": {"logBucketName": "is24-cloudtrail-logs", "includeGlobalServices": False},
}
),
}
expected = ["vpc", "default-sg", "app1", "app2"]
self.assertEqual(expected, DependencyResolver.get_stack_order(stacks))
示例8: test_get_stack_order_accepts_stacks_without_parameters_key
# 需要導入模塊: from cfn_sphere.stack_configuration.dependency_resolver import DependencyResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.dependency_resolver.DependencyResolver import get_stack_order [as 別名]
def test_get_stack_order_accepts_stacks_without_parameters_key(self):
stacks = {"default-sg": {}, "app1": None, "app2": {}, "vpc": {}}
result = 4
self.assertEqual(result, len(DependencyResolver.get_stack_order(stacks)))