Source code for runway.cfngin.providers.base

"""Provider base class."""
# pylint: disable=no-self-use,too-few-public-methods,unused-argument


[docs]def not_implemented(method): """Wrap NotImplimentedError with a formatted message.""" raise NotImplementedError("Provider does not support '%s' method." % method)
[docs]class BaseProviderBuilder(object): """ProviderBuilder base class."""
[docs] def build(self, region=None): """Abstract method.""" not_implemented("build")
[docs]class BaseProvider(object): """Provider base class."""
[docs] def get_stack(self, stack_name, *args, **kwargs): """Abstract method.""" not_implemented("get_stack")
[docs] def create_stack(self, *args, **kwargs): """Abstract method.""" not_implemented("create_stack")
[docs] def update_stack(self, *args, **kwargs): """Abstract method.""" not_implemented("update_stack")
[docs] def destroy_stack(self, stack, *args, **kwargs): """Abstract method.""" not_implemented("destroy_stack")
[docs] def get_stack_status(self, stack, *args, **kwargs): """Abstract method.""" not_implemented("get_stack_status")
[docs] def get_outputs(self, stack_name, *args, **kwargs): """Abstract method.""" not_implemented("get_outputs")
[docs] def get_output(self, stack, output): """Abstract method.""" return self.get_outputs(stack)[output]
[docs]class Template(object): """CloudFormation stack template, which could be optionally uploaded to s3. Presence of the url attribute indicates that the template was uploaded to S3, and the uploaded template should be used for ``CreateStack``/``UpdateStack`` calls. """ def __init__(self, url=None, body=None): """Instantiate class.""" self.url = url self.body = body