diff options
author | Tim Burke <tim.burke@gmail.com> | 2017-01-20 19:41:15 +0000 |
---|---|---|
committer | Ondřej Nový <ondrej.novy@firma.seznam.cz> | 2017-02-21 20:28:41 +0100 |
commit | dd3a74946921ff253e4c36517dcbb573e7c8e902 (patch) | |
tree | 2d1706d35fdce166993050bf159fb8afdd5ed7b1 | |
parent | a4c1b3e6832e22953d614560959e042afcc687a4 (diff) | |
download | swift-dd3a74946921ff253e4c36517dcbb573e7c8e902.tar.gz |
Simplify get_different_suffix_df args
Change-Id: I18a775c5b61c43c112f3658f9c27c7d4149ebbef
Related-Change: I3a661fae5c7cfeb2dbcdb7f46941f55244d0b9ad
-rw-r--r-- | test/unit/obj/test_diskfile.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/obj/test_diskfile.py b/test/unit/obj/test_diskfile.py index 8e3ab8396..4291f1a72 100644 --- a/test/unit/obj/test_diskfile.py +++ b/test/unit/obj/test_diskfile.py @@ -5189,15 +5189,17 @@ class TestSuffixHashes(unittest.TestCase): filename += '.meta' return filename - def get_different_suffix_df(self, df, df_mgr, device, partition, - account, container, **kwargs): + def get_different_suffix_df(self, df): # returns diskfile in the same partition with different suffix suffix_dir = os.path.dirname(df._datadir) - i = 0 - while True: - df2 = df_mgr.get_diskfile(device, partition, account, container, - 'o%d' % i, **kwargs) - i += 1 + for i in itertools.count(): + df2 = df._manager.get_diskfile( + df._device_path, + df._datadir.split('/')[-3], + df._account, + df._container, + 'o%d' % i, + policy=df.policy) suffix_dir2 = os.path.dirname(df2._datadir) if suffix_dir != suffix_dir2: return df2 @@ -5599,9 +5601,7 @@ class TestSuffixHashes(unittest.TestCase): # invalidate a different suffix hash in same partition but not in # existing hashes.pkl - df2 = self.get_different_suffix_df(df, df_mgr, - 'sda1', '0', 'a', 'c', - policy=policy) + df2 = self.get_different_suffix_df(df) df2.delete(self.ts()) suffix_dir2 = os.path.dirname(df2._datadir) suffix2 = os.path.basename(suffix_dir2) |