Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Modify the load_community_scripts logic to add
env and run_as_user keys.
  • Loading branch information
cdp1337 committed Aug 15, 2024
1 parent 751b0ef commit 9054c23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/tacticalrmm/scripts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ def load_community_scripts(cls):

args = script["args"] if "args" in script.keys() else []

env = script["env"] if "env" in script.keys() else []

syntax = script["syntax"] if "syntax" in script.keys() else ""

run_as_user = script["run_as_user"] if "run_as_user" in script.keys() else False

supported_platforms = (
script["supported_platforms"]
if "supported_platforms" in script.keys()
Expand All @@ -135,7 +139,9 @@ def load_community_scripts(cls):
i.shell = script["shell"]
i.default_timeout = default_timeout
i.args = args
i.env_vars = env
i.syntax = syntax
i.run_as_user = run_as_user
i.filename = script["filename"]
i.supported_platforms = supported_platforms

Expand Down Expand Up @@ -163,8 +169,10 @@ def load_community_scripts(cls):
category=category,
default_timeout=default_timeout,
args=args,
env_vars=env,
filename=script["filename"],
syntax=syntax,
run_as_user=run_as_user,
supported_platforms=supported_platforms,
)
# new_script.hash_script_body() # also saves script
Expand Down

0 comments on commit 9054c23

Please sign in to comment.