示例#1
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.purpose = check_type(args.get("purpose"), str)
        self.command = check_type(args.get("command"), list)
        self.watching = check_type(args.get("files"), list)
        self.working_dir = check_type(args.get("working_dir", "/"), str)
示例#2
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.working_dir = check_type(args.get("working_dir"), str)

        # relative to working dir
        self.script = check_type(args.get("script"), str)
示例#3
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.user_name = check_type(args.get("name"), str)
        self.make_group = check_type(args.get("make_group", True), bool)
        self.make_home = check_type(args.get("make_home", True), bool)
        self.home: Optional[str] = check_type_opt(args.get("home"), str)
        self.password: Optional[str] = check_type_opt(args.get("password"),
                                                      str)
示例#4
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        unit = check_type(args.get("unit"), str)
        self.unit_name = unit if "." in unit else unit + ".service"
        self.at = check_type(args.get("at"), str)
        self.enabled = check_type_opt(args.get("enabled"), bool)
        self.restart_on = check_type_opt(args.get("restart_on"), list)
        self.started = check_type_opt(args.get("started"), bool)
示例#5
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.database_name = check_type(args.get("name"), str)
        self.owner = check_type(args.get("owner"), str)
        self.encoding = args.get("encoding", "utf8")
        # en_GB.UTF-8 may have perf impact and needs to be installed as a locale
        # with locale-gen on Ubuntu. In short, a pain.
        # C or POSIX is recommended.
        self.collate = args.get("collate", "C")
        self.ctype = args.get("ctype", "C")
        self.template = args.get("template", "template0")
示例#6
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.dir = check_type(args.get("dir"), str)
        self.interpreter = check_type(args.get("interpreter"), str)
        # list of flags. Current supported:
        # git (local git repo — track hash by git commit hash), dir, -r
        self.install: List[Tuple[str, List[str]]] = []
        install_plaintext = check_type(args.get("install"), list)
        for install_line in install_plaintext:
            parts = install_line.split(" ")
            self.install.append((parts[-1], parts[0:-1]))

        self.no_apt_install = check_type(args.get("_no_apt_install", False),
                                         bool)
示例#7
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.repo_src = check_type(args.get("src"), str)
        self.dest_dir = check_type(args.get("dest"), str)
        self.ref = check_type_opt(args.get("ref"), str)
        self.branch = check_type_opt(args.get("branch"), str)

        if not (self.ref or self.branch):
            raise ValueError("Need to specify 'ref' or 'branch'")

        if self.ref and self.branch:
            raise ValueError("Can't specify both 'ref' and 'branch'.")

        # should end with / if it's a dir
        self.expect: List[str] = check_type(args.get("expect", []), list)
        self.submodules = check_type(args.get("submodules", False), bool)
示例#8
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.name = check_type(args.get("name"), str)
        self.driver = check_type_opt(args.get("driver"), str)
        self.check_duplicate = check_type_opt(args.get("check_duplicate"),
                                              bool)
        self.internal = check_type_opt(args.get("internal"), bool)
        self.enable_ipv6 = check_type_opt(args.get("enable_ipv6"), bool)
        self.attachable = check_type_opt(args.get("attachable"), bool)
        self.scope = check_type_opt(args.get("scope"), str)
        self.ingress = check_type_opt(args.get("ingress"), bool)
示例#9
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.name = check_type(args.get("name"), str)
示例#10
0
 def __init__(self, recipe_context: RecipeContext, args: dict, head):
     super().__init__(recipe_context, args, head)
     self.packages: List[str] = check_type(args["packages"], list)
示例#11
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.repository = check_type(args.get("repository"), str)
        self.tag = check_type(args.get("tag"), str)
示例#12
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.image = check_type(args.get("image"), str)
        self.command = check_type(args.get("command"), str)
示例#13
0
    def __init__(self, recipe_context: RecipeContext, args: dict, head):
        super().__init__(recipe_context, args, head)

        self.tar = check_type(args.get("tar"), str)
        self.dir = check_type(args.get("dir"), str)
        self.expect_files = check_type(args.get("expects_files"), List[str])