Skip to content

Commit

Permalink
Add env node in task config.
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusstefan committed Aug 29, 2024
1 parent 1e28499 commit 555bd92
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion sipssert/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def get_args(self):
return self.get_task_args() + self.get_config_args()

def get_task_env(self):
return {}
env = self.config.get("env", {})
return env

def run(self):
self.container.start()
Expand Down
3 changes: 1 addition & 2 deletions sipssert/tasks/mysql-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def __init__(self, test_dir, config):
self.script = os.path.join(self.mount_point, self.script)

def get_task_env(self):

env_dict = {}
env_dict = self.config.get("env", {})

if "user" in self.config:
self.user = self.config["user"]
Expand Down
4 changes: 2 additions & 2 deletions sipssert/tasks/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ class MysqlTask(Task):

def get_task_env(self):

env_dict = {}
env_dict = self.config.get("env", {})

if "root_password" in self.config:
self.root_password = self.config["root_password"]

if self.root_password:
env_dict["MYSQL_ROOT_PASSWORD"] = self.root_password
else:
env_dict = self.mysql_default_env
env_dict.update(self.mysql_default_env)

return env_dict

Expand Down
4 changes: 2 additions & 2 deletions sipssert/tasks/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ class PostgresqlTask(Task):

def get_task_env(self):

env_dict = {}
env_dict = self.config.get("env", {})

if "postgres_password" in self.config:
self.root_password = self.config["postgres_password"]

if self.root_password:
env_dict["POSTGRES_PASSWORD"] = self.root_password
else:
env_dict = self.postgresql_default_env
env_dict.update(self.postgresql_default_env)

return env_dict

Expand Down

0 comments on commit 555bd92

Please sign in to comment.