diff options
author | BonfaceKilz | 2021-06-29 13:16:09 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-06-29 14:50:30 +0300 |
commit | d6715cff2e5a1771b22bb2ce7680347cad501841 (patch) | |
tree | 5b9f93385e15ae47cee632eacf4e1e84f9845f62 /gn3/commands.py | |
parent | 69da1064e0815f4c60584a977d928c64c3f68507 (diff) | |
download | genenetwork3-d6715cff2e5a1771b22bb2ce7680347cad501841.tar.gz |
Replace list with a tuple as an argument when setting success_codes
* gn3/commands.py (run_cmd): Replace type of success_codes from List to Tuple
* gn3/computations/diff.py (generate_diff): Pass success_codes as a Tuple when
calling "run_cmd".
Diffstat (limited to 'gn3/commands.py')
-rw-r--r-- | gn3/commands.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/commands.py b/gn3/commands.py index 0f526d8..7d42ced 100644 --- a/gn3/commands.py +++ b/gn3/commands.py @@ -6,6 +6,7 @@ from datetime import datetime from typing import Dict from typing import List from typing import Optional +from typing import Tuple from uuid import uuid4 from redis.client import Redis # Used only in type hinting @@ -74,7 +75,7 @@ Returns the name of the specific redis hash for the specific task. return unique_id -def run_cmd(cmd: str, success_codes: List = [0]) -> Dict: +def run_cmd(cmd: str, success_codes: Tuple = (0,)) -> Dict: """Run CMD and return the CMD's status code and output as a dict""" results = subprocess.run(cmd, capture_output=True, shell=True, check=False) |