From c692e0acd2c1b3cedc630b22933751f5a0cfeac3 Mon Sep 17 00:00:00 2001 From: Olivier Date: Wed, 10 Mar 2021 15:27:49 +0000 Subject: [PATCH] Allow skipping the database need. --- scone/default/recipes/postgres.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scone/default/recipes/postgres.py b/scone/default/recipes/postgres.py index 7168166..98fafe6 100644 --- a/scone/default/recipes/postgres.py +++ b/scone/default/recipes/postgres.py @@ -147,10 +147,14 @@ class PostgresCommands(Recipe): self.database = check_type(args.get("database"), str) self.commands = check_type(args.get("commands"), list) + self.skip_database_need = check_type( + args.get("skip_database_need", False), bool + ) def prepare(self, preparation: Preparation, head: Head) -> None: super().prepare(preparation, head) - preparation.needs("postgres-database", self.database) + if not self.skip_database_need: + preparation.needs("postgres-database", self.database) async def cook(self, kitchen: Kitchen) -> None: ch = await kitchen.start(PostgresTransaction(self.database))