Module ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Raise Call NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Raise Call NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Return Call NameLoad NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad Expr Call NameLoad AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str Str Str Str For NameStore NameLoad body With Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Num Num Assign NameStore BinOpSub NameLoad Num ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num If CompareGtE AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr decorator_list decorator_list Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr With Call AttributeLoad NameLoad attr Str Call NameLoad body FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return ListComp TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Str Str comprehension NameStore NameLoad decorator_list With Call AttributeLoad NameLoad attr Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult Num NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult Num NameLoad FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list With Call AttributeLoad NameLoad attr Str NameLoad body With Call AttributeLoad NameLoad attr Str Call NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult Num NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult Num NameLoad decorator_list Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return ListComp TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Str Str comprehension NameStore NameLoad decorator_list With Call AttributeLoad NameLoad attr Str NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return ListComp TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Str Str comprehension NameStore NameLoad decorator_list Assign AttributeStore NameLoad attr Num With Call AttributeLoad NameLoad attr Str NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Str NameLoad decorator_list ClassDef bases NameLoad AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult Call NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad AttributeLoad NameLoad attr Num Num Num Call NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad Index Call NameLoad NameLoad Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Call NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr With Call AttributeLoad NameLoad attr NameStore body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str attr For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad decorator_list decorator_list NameLoad ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore GeneratorExp AttributeLoad Call NameLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult Call NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad Num Num Num Call NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad Index Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad With Call AttributeLoad NameLoad attr NameStore body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Call NameLoad NameLoad Index Str BinOpSub SubscriptLoad NameLoad Index Call NameLoad NameLoad Num Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Num Assign NameStore SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr CompareIn Str NameLoad Expr Call AttributeLoad NameLoad attr CompareIn Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Num decorator_list NameLoad decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A collections defaultdict N/A itertools N/A unittest N/A mock N/A time N/A os N/A random tempfile mkdtemp shutil rmtree eventlet Timeout swift.account auditor swift.common.storage_policy POLICIES swift.common.utils Timestamp test.unit debug_logger patch_policies with_tempdir test.unit.account.test_backend AccountBrokerPreTrackContainerCountSetup FakeAccountBroker N/A object N/A __init__ N/A N/A self path N/A N/A N/A N/A self path path N/A N/A self db_file path N/A N/A self file N/A N/A N/A os path basename path N/A is_deleted N/A N/A self N/A N/A N/A False N/A get_info N/A N/A self N/A N/A N/A N/A N/A N/A self file startswith fail N/A N/A N/A ValueError N/A N/A N/A N/A self file startswith true N/A N/A N/A defaultdict int N/A get_policy_stats N/A N/A self N/A kwargs N/A N/A N/A N/A N/A self file startswith fail N/A N/A N/A ValueError N/A N/A N/A N/A self file startswith true N/A N/A N/A defaultdict int N/A N/A TestAuditor N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A self testdir N/A N/A N/A os path join N/A mkdtemp tmp_test_account_auditor N/A N/A self logger N/A debug_logger N/A N/A rmtree N/A self testdir ignore_errors 1 N/A N/A N/A os mkdir N/A self testdir N/A fnames N/A true1.db true2.db true3.db fail1.db fail2.db N/A fn fnames N/A N/A N/A open N/A N/A N/A os path join N/A self testdir fn w+ f N/A N/A N/A N/A f write N/A tearDown N/A N/A self N/A N/A N/A N/A rmtree N/A N/A N/A os path dirname N/A self testdir ignore_errors 1 N/A test_run_forever N/A N/A self N/A N/A N/A sleep_times N/A N/A random randint 5 10 N/A call_times N/A sleep_times 1 FakeTime N/A object N/A __init__ N/A N/A self N/A N/A N/A N/A self times 0 N/A sleep N/A N/A self sec N/A N/A N/A N/A self times 1 N/A N/A N/A self times sleep_times N/A N/A N/A ValueError N/A time N/A N/A self N/A N/A N/A N/A N/A time time N/A N/A N/A conf N/A N/A test_auditor N/A N/A auditor AccountAuditor conf logger N/A self logger N/A N/A N/A mock patch swift.account.auditor.time N/A FakeTime N/A fake_audit_location_generator N/A N/A N/A args kwargs N/A N/A files N/A N/A os listdir N/A self testdir N/A N/A N/A N/A N/A N/A os path join N/A self testdir f N/A f files N/A N/A N/A N/A mock patch swift.account.auditor.audit_location_generator fake_audit_location_generator N/A N/A N/A N/A self assertRaises ValueError N/A test_auditor run_forever N/A N/A N/A self assertEqual N/A test_auditor account_failures N/A 2 call_times N/A N/A N/A self assertEqual N/A test_auditor account_passes N/A 3 call_times fake_one_audit_pass N/A N/A reported N/A N/A N/A N/A Timeout N/A N/A N/A N/A mock patch swift.account.auditor.AccountAuditor._one_audit_pass fake_one_audit_pass N/A N/A N/A N/A mock patch swift.account.auditor.time N/A FakeTime N/A N/A N/A N/A self assertRaises ValueError N/A test_auditor run_forever N/A N/A N/A self assertEqual N/A test_auditor account_failures N/A 2 call_times N/A N/A N/A self assertEqual N/A test_auditor account_passes N/A 3 call_times N/A N/A N/A mock patch swift.account.auditor.AccountBroker FakeAccountBroker test_run_once N/A N/A self N/A N/A N/A conf N/A N/A test_auditor N/A N/A auditor AccountAuditor conf logger N/A self logger fake_audit_location_generator N/A N/A N/A args kwargs N/A N/A files N/A N/A os listdir N/A self testdir N/A N/A N/A N/A N/A N/A os path join N/A self testdir f N/A f files N/A N/A N/A N/A mock patch swift.account.auditor.audit_location_generator fake_audit_location_generator N/A N/A N/A N/A test_auditor run_once N/A N/A N/A self assertEqual N/A test_auditor account_failures 2 N/A N/A N/A self assertEqual N/A test_auditor account_passes 3 N/A N/A N/A mock patch swift.account.auditor.AccountBroker FakeAccountBroker test_one_audit_pass N/A N/A self N/A N/A N/A conf N/A N/A test_auditor N/A N/A auditor AccountAuditor conf logger N/A self logger fake_audit_location_generator N/A N/A N/A args kwargs N/A N/A files N/A N/A os listdir N/A self testdir N/A N/A N/A N/A N/A N/A os path join N/A self testdir f N/A f files N/A N/A N/A test_auditor logging_interval 0 N/A N/A N/A mock patch swift.account.auditor.audit_location_generator fake_audit_location_generator N/A N/A N/A N/A test_auditor _one_audit_pass N/A test_auditor logging_interval N/A N/A N/A self assertEqual N/A test_auditor account_failures 0 N/A N/A N/A self assertEqual N/A test_auditor account_passes 0 N/A N/A N/A mock patch swift.account.auditor.AccountBroker FakeAccountBroker test_account_auditor N/A N/A self N/A N/A N/A conf N/A N/A test_auditor N/A N/A auditor AccountAuditor conf logger N/A self logger N/A files N/A N/A os listdir N/A self testdir N/A f files N/A N/A path N/A N/A N/A os path join N/A self testdir f N/A N/A N/A test_auditor account_audit path N/A N/A N/A self assertEqual N/A test_auditor account_failures 2 N/A N/A N/A self assertEqual N/A test_auditor account_passes 3 N/A N/A N/A mock patch swift.account.auditor.AccountBroker FakeAccountBroker N/A TestAuditorRealBrokerMigration N/A AccountBrokerPreTrackContainerCountSetup N/A unittest TestCase N/A test_db_migration N/A N/A self N/A N/A N/A policies N/A N/A itertools cycle POLICIES N/A num_containers N/A N/A len POLICIES 3 N/A per_policy_container_counts N/A defaultdict int N/A i N/A range num_containers N/A N/A name N/A test-container-%02d i N/A policy N/A next policies N/A N/A N/A N/A self broker put_container name N/A next N/A self ts 0 0 0 N/A int policy N/A N/A per_policy_container_counts N/A N/A int policy 1 N/A N/A N/A N/A self broker _commit_puts N/A N/A N/A self assertEqual num_containers N/A N/A N/A N/A self broker get_info N/A container_count N/A N/A N/A self assertUnmigrated N/A self broker N/A conf N/A devices mount_check recon_cache_path N/A self tempdir False N/A self tempdir N/A test_auditor N/A N/A auditor AccountAuditor conf logger N/A debug_logger N/A N/A N/A test_auditor run_once N/A N/A N/A self restore_account_broker N/A broker N/A N/A auditor AccountBroker N/A self db_path N/A N/A N/A broker get conn N/A N/A rows N/A N/A N/A N/A conn execute 
                SELECT storage_policy_index, container_count
                FROM policy_stat
             fetchall N/A N/A policy_index container_count rows N/A N/A N/A N/A self assertEqual container_count N/A per_policy_container_counts N/A policy_index N/A N/A patch_policies TestAuditorRealBroker N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A self logger N/A debug_logger N/A test_db_validate_fails N/A N/A self tempdir N/A N/A N/A ts N/A N/A N/A Timestamp t internal N/A t N/A N/A itertools count N/A int N/A N/A time time N/A db_path N/A N/A N/A os path join tempdir sda accounts 0 0 0 test.db N/A broker N/A N/A auditor AccountBroker db_path account a N/A N/A N/A broker initialize N/A next ts N/A policies N/A N/A itertools cycle POLICIES N/A num_containers N/A N/A len POLICIES 3 N/A per_policy_container_counts N/A defaultdict int N/A i N/A range num_containers N/A N/A name N/A test-container-%02d i N/A policy N/A next policies N/A N/A N/A broker put_container name N/A next ts 0 0 0 N/A int policy N/A N/A per_policy_container_counts N/A N/A int policy 1 N/A N/A N/A broker _commit_puts N/A N/A N/A self assertEqual N/A N/A N/A broker get_info N/A container_count num_containers N/A messed_up_policy N/A N/A random choice N/A list POLICIES N/A N/A N/A broker get conn N/A N/A N/A N/A conn executescript N/A 
                UPDATE policy_stat
                SET container_count = container_count - 1
                WHERE storage_policy_index = %d;
             N/A int messed_up_policy N/A policy_stats N/A N/A broker get_policy_stats N/A N/A N/A self assertEqual N/A N/A policy_stats N/A N/A int messed_up_policy N/A container_count N/A N/A per_policy_container_counts N/A N/A int messed_up_policy 1 N/A conf N/A devices mount_check recon_cache_path tempdir False tempdir N/A test_auditor N/A N/A auditor AccountAuditor conf logger N/A self logger N/A N/A N/A test_auditor run_once N/A N/A N/A self assertEqual N/A test_auditor account_failures 1 N/A error_lines N/A N/A N/A test_auditor logger get_lines_for_level error N/A N/A N/A self assertEqual N/A len error_lines 1 N/A error_message N/A error_lines N/A 0 N/A N/A N/A self assertTrue N/A N/A broker db_file error_message N/A N/A N/A self assertTrue N/A container_count error_message N/A N/A N/A self assertTrue N/A does not match error_message N/A N/A N/A self assertEqual N/A N/A N/A test_auditor logger get_increment_counts N/A failures 1 N/A with_tempdir N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main