From 0733dd118e463f73caa9155b97fc8d9b02759e06 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 13 Jan 2024 13:02:36 +0100 Subject: [PATCH] fix: add ability to set secret variable from python --- python-client/wmill/wmill/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python-client/wmill/wmill/client.py b/python-client/wmill/wmill/client.py index 5f0f7a3b6a..1daf1f3d02 100644 --- a/python-client/wmill/wmill/client.py +++ b/python-client/wmill/wmill/client.py @@ -250,7 +250,7 @@ class Windmill: """Get variable from Windmill""" return self.get(f"/w/{self.workspace}/variables/get_value/{path}").json() - def set_variable(self, path: str, value: str) -> None: + def set_variable(self, path: str, value: str, is_secret: bool = False) -> None: """Set variable from Windmill""" # check if variable exists r = self.get(f"/w/{self.workspace}/variables/get/{path}", raise_for_status=False) @@ -261,7 +261,7 @@ class Windmill: json={ "path": path, "value": value, - "is_secret": False, + "is_secret": is_secret, "description": "", }, ) @@ -689,11 +689,11 @@ def get_variable(path: str) -> str: @init_global_client -def set_variable(path: str, value: str) -> None: +def set_variable(path: str, value: str, is_secret: bool = False) -> None: """ Set the variable at a given path as a string, creating it if it does not exist """ - return _client.set_variable(path, value) + return _client.set_variable(path, value, is_secret) @init_global_client