Skip to content

Commit 72f4cc5

Browse files
authored
Merge pull request ceph#62567 from tchaikov/qa-remove-unused-global
cephfs-top, qa: Remove unnecessary global statements in tests Reviewed-by: Ronen Friedman <[email protected]> Reviewed-by: John Mulligan <[email protected]> Reviewed-by: Casey Bodley <[email protected]>
2 parents 7861012 + 39b262f commit 72f4cc5

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

qa/tasks/radosgw_admin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ def task(ctx, config):
327327
"""
328328
Test radosgw-admin functionality against a running rgw instance.
329329
"""
330-
global log
331330

332331
assert ctx.rgw.config, \
333332
"radosgw_admin task needs a config passed from the rgw task"

qa/workunits/dencoder/test_readable.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def process_type(file_path, type):
9696
return 0 # File passed the test
9797

9898
def test_object_wrapper(type, vdir, arversion, current_ver):
99-
global incompat_paths
10099
_numtests = 0
101100
_failed = 0
102101
unrecognized = ""
@@ -161,8 +160,6 @@ def should_skip_object(type, arversion, current_ver):
161160
Returns:
162161
bool: True if the object should be skipped, False otherwise.
163162
"""
164-
global backward_compat
165-
global fast_shouldnt_skip
166163

167164
# Validate global structures
168165
if not isinstance(backward_compat, dict) or not isinstance(fast_shouldnt_skip, list):

src/tools/cephfs/top/cephfs-top

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ class FSTop(FSTopBase):
341341
except Exception as e:
342342
raise FSTopException(f'Error in fs ls: {e}')
343343
fs_map = json.loads(buf.decode('utf-8'))
344-
global fs_list
345344
fs_list.clear()
346345
for filesystem in fs_map:
347346
fs = filesystem['name']
@@ -463,7 +462,7 @@ class FSTop(FSTopBase):
463462
key = 0
464463
endwhile = False
465464
while not endwhile:
466-
global current_states, fs_list
465+
global fs_list
467466
fs_list = self.get_fs_names()
468467

469468
if key == curses.KEY_UP and curr_row1 > 0:
@@ -869,7 +868,6 @@ class FSTop(FSTopBase):
869868
xp += len(self.items(item)) + ITEMS_PAD_LEN
870869

871870
def create_clients(self, stats_json, fs_name):
872-
global metrics_dict, current_states
873871
counters = [m.upper() for m in stats_json[GLOBAL_COUNTERS_KEY]]
874872
self.tablehead_y += 2
875873
res = stats_json[GLOBAL_METRICS_KEY].get(fs_name, {})
@@ -908,7 +906,6 @@ class FSTop(FSTopBase):
908906
if not stats_json['version'] == FS_TOP_SUPPORTED_VER:
909907
self.header.addstr(0, 0, 'perf stats version mismatch!', curses.A_BOLD)
910908
return False
911-
global fs_list
912909
for fs_name in fs_list:
913910
client_metadata = stats_json[CLIENT_METADATA_KEY].get(fs_name, {})
914911
client_cnt = len(client_metadata)
@@ -978,7 +975,7 @@ class FSTop(FSTopBase):
978975

979976
curses.halfdelay(1)
980977
cmd = self.stdscr.getch()
981-
global fs_list, current_states
978+
global fs_list
982979
while not self.exit_ev.is_set():
983980
fs_list = self.get_fs_names()
984981
fs = current_states["last_fs"]
@@ -1123,7 +1120,7 @@ class FSTop(FSTopBase):
11231120
self.exit_ev.set()
11241121

11251122
# header display
1126-
global fs_list, current_states
1123+
global fs_list
11271124
fs_list = self.get_fs_names()
11281125
current_states["last_fs"] = fs_list
11291126
stats_json = self.perf_stats_query()

0 commit comments

Comments
 (0)