9 Read json output of admin socket command 'objecter_requests' from
10 stdin, and check it for internal consistency and presence of
13 read = sys.stdin.read()
14 reqs = json.loads(read)
16 op_types = ['linger_ops', 'ops', 'pool_ops', 'pool_stat_ops', 'statfs_ops', 'command_ops']
17 assert sorted(reqs.keys()) == sorted(op_types)
19 found_error = check_osd_ops(reqs['ops'] + reqs['linger_ops'])
20 assert not found_error, "ERRORS FOUND!"
23 def check_osd_ops(ops):
29 def add_to_mapping(mapping, key, value, msg):
31 if mapping[key] != value:
32 print('%s != %s' % (mapping[key], value))
41 key=(op['object_id'], op['object_locator']),
43 msg='ERROR: two ops for the same object mapped to different pgs',
48 value=op['object_locator'],
49 msg='ERROR: requests to the same object had different locators',
55 msg='ERROR: two ops mapped a pg to different osds',
59 if __name__ == '__main__':