From 9561d7b16e4a32e82e59989cba86973b081d307e Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 18 Sep 2024 17:07:42 +0200 Subject: [PATCH] Fix indentation and formatting. --- src/err-stackstorm/errst2lib/enquiry.py | 18 +++++++++--------- src/err-stackstorm/errst2lib/stackstorm_api.py | 3 +-- src/err-stackstorm/st2.py | 5 +++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/err-stackstorm/errst2lib/enquiry.py b/src/err-stackstorm/errst2lib/enquiry.py index d9c3a54..4e128cd 100644 --- a/src/err-stackstorm/errst2lib/enquiry.py +++ b/src/err-stackstorm/errst2lib/enquiry.py @@ -70,7 +70,7 @@ def __init__(self, enquiry, ttl=3600): The Enquiry class wraps the St2 API response in a Python Object. The Python object tracks the answers provided for the specific enquiry and maintains a time to live for answers to be considered abandonned. - + enquiry: the stackstorm enquiry API response object in JSON form. ttl: seconds to consider the enquiry should remain. """ @@ -82,14 +82,14 @@ def __init__(self, enquiry, ttl=3600): @classmethod def get_associated_data(cls): - """ - The enquiry data is insufficent to identify it's association with a specific workflow. - The get_associated_data queries the associated execution_id and then the associated workflow. - to collect descriptions - """ - raise NotImplementedError - - + """ + The enquiry data is insufficent to identify it's association + with a specific workflow. The get_associated_data queries the + associated execution_id and then the associated workflow. to + collect descriptions + """ + raise NotImplementedError + @property def id(self): return self.enquiry_data["id"] diff --git a/src/err-stackstorm/errst2lib/stackstorm_api.py b/src/err-stackstorm/errst2lib/stackstorm_api.py index be735ee..1245291 100644 --- a/src/err-stackstorm/errst2lib/stackstorm_api.py +++ b/src/err-stackstorm/errst2lib/stackstorm_api.py @@ -44,11 +44,10 @@ def refresh_bot_credentials(self): def action_get(self, action_id): raise NotImplementedError - + def workflow_get(self, action_id): raise NotImplementedError - def enquiry_list(self, st2_creds=None): """ curl -X GET -H 'X-Auth-Token: X' 'http://127.0.0.1:9101/v1/inquiries/?limit=50' diff --git a/src/err-stackstorm/st2.py b/src/err-stackstorm/st2.py index b374716..7aa60f9 100644 --- a/src/err-stackstorm/st2.py +++ b/src/err-stackstorm/st2.py @@ -351,7 +351,7 @@ def remove_bot_prefix(msg): action_alias = matched_result.message["actionalias"] del matched_result - if action_alias.get("enabled", True) == False: + if action_alias.get("enabled", True) is False: return "The command '{}' is disabled.".format(msg.body) actionalias_exec_result = self.st2api.execute_actionalias( @@ -359,7 +359,8 @@ def remove_bot_prefix(msg): ) LOG.debug( - f"action alias execution result: type={type(actionalias_exec_result)} {actionalias_exec_result}" + f"action alias execution result: " + "type={type(actionalias_exec_result)} {actionalias_exec_result}" ) if not isinstance(actionalias_exec_result, dict):