How to use the yay.config.Config function in yay

To help you get started, we’ve selected a few yay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yaybu / yaybu / yaybu / provisioner / resource.py View on Github external
def create_from_list(cls, specification):
        """ Given a list of types and parameters, build a resource bundle """
        c = Config()
        c.add({"resources": specification})
        return cls.create_from_yay_expression(c.resources)
github yaybu / yaybu / yaybu / core / config.py View on Github external
return

        self.schema = {}
        for arg in args:
            yarg = YaybuArg(
                str(arg.name),
                arg.type.as_string('string'),
                arg.default.as_string(None),
                arg.help.as_string(None),
            )
            self.add(yarg)

        self.members.update(self.parse())


class Config(BaseConfig):

    """
    This class adapts ``yay.config.Config`` for use in Yaybu. In particular it
    helps to ensure that Yaybu API users only have to deal with Yaybu
    exceptions and not yay exceptions. It also applies so default Yaybu
    policies like looking in ``~/.yaybu/`` for certain things.
    """

    readonly = False
    simulate = False

    default_builtins = {
        "Compute": Compute,
        "Provisioner": Provision,
        "LoadBalancer": LoadBalancer,
        "Zone": Zone,