Skip to content

Commit 83904f6

Browse files
committedApr 2, 2022
Bump black to v22.3.0 and update format
1 parent 2a9a3dc commit 83904f6

File tree

8 files changed

+13
-10
lines changed

8 files changed

+13
-10
lines changed
 

‎contrib/packs/actions/pack_mgmt/get_installed.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
class GetInstalled(Action):
30-
""""Get information about installed pack."""
30+
"""Get information about installed pack."""
3131

3232
def run(self, pack):
3333
"""

‎contrib/runners/local_runner/tests/integration/test_localrunner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def test_large_stdout(self):
629629
)
630630
runner = self._get_runner(action_db, entry_point=entry_point)
631631
runner.pre_run()
632-
char_count = 10 ** 6 # Note 10^7 succeeds but ends up being slow.
632+
char_count = 10**6 # Note 10^7 succeeds but ends up being slow.
633633
status, result, _ = runner.run({"chars": char_count})
634634
runner.post_run(status, result)
635635
self.assertEqual(status, action_constants.LIVEACTION_STATUS_SUCCEEDED)

‎st2actions/st2actions/scheduler/handler.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,12 @@ def _cleanup_policy_delayed(self):
173173
)
174174
)
175175
except db_exc.StackStormDBObjectWriteConflictError:
176-
msg = '[%s] Item "%s" is currently being processed by another scheduler.' % (
177-
execution_queue_item_db.action_execution_id,
178-
str(execution_queue_item_db.id),
176+
msg = (
177+
'[%s] Item "%s" is currently being processed by another scheduler.'
178+
% (
179+
execution_queue_item_db.action_execution_id,
180+
str(execution_queue_item_db.id),
181+
)
179182
)
180183
LOG.error(msg)
181184
raise Exception(msg)

‎st2api/st2api/controllers/resource.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _get_all(
188188

189189
# TODO: To protect us from DoS, we need to make max_limit mandatory
190190
offset = int(offset)
191-
if offset >= 2 ** 31:
191+
if offset >= 2**31:
192192
raise ValueError('Offset "%s" specified is more than 32-bit int' % (offset))
193193

194194
limit = validate_limit_query_param(limit=limit, requester_user=requester_user)

‎st2api/tests/unit/controllers/v1/test_executions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ def test_re_run_with_very_large_delay(self):
871871
self.assertEqual(post_resp.status_int, 201)
872872
execution_id = self._get_actionexecution_id(post_resp)
873873

874-
delay_time = 10 ** 10
874+
delay_time = 10**10
875875
data = {"delay": delay_time}
876876
re_run_resp = self.app.post_json(
877877
"/v1/executions/%s/re_run" % (execution_id), data

‎st2common/st2common/middleware/logging.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def custom_start_response(status, headers, exc_info=None):
111111
"path": request.path,
112112
"remote_addr": request.remote_addr,
113113
"status": status_code[0],
114-
"runtime": float("{0:.3f}".format((clock() - start_time) * 10 ** 3)),
114+
"runtime": float("{0:.3f}".format((clock() - start_time) * 10**3)),
115115
"content_length": content_length[0]
116116
if content_length
117117
else len(b"".join(retval)),

‎st2reactor/st2reactor/container/hash_partitioner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Range(object):
3535
RANGE_MIN_VALUE = 0
3636

3737
RANGE_MAX_ENUM = "max"
38-
RANGE_MAX_VALUE = 2 ** 32
38+
RANGE_MAX_VALUE = 2**32
3939

4040
def __init__(self, range_repr):
4141
self.range_start, self.range_end = self._get_range_boundaries(range_repr)

‎test-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ st2flake8==0.1.0
55
astroid==2.5.6
66
pylint==2.8.2
77
pylint-plugin-utils>=0.4
8-
black==20.8b1
8+
black==22.3.0
99
pre-commit==2.1.0
1010
bandit==1.7.0
1111
ipython<6.0.0

0 commit comments

Comments
 (0)