Fix a potential bug

In the class method from_hash_dir(), the arguments to input when creating an instance of the BaseDiskFile class are incorrect.
The __init__() method of BaseDiskFile class receive the arguments in order of mgr, device_path, partition and etc.
However, in from_hash_dir() method, the order of arguments are mgr, device_path, None and partition
The class method from_hash_dir() is used by the Object Auditor.
If the partition argument is used in the new DiskFile implementations, exception may occur.
It will be cause object auditing to failed and the object will be quarantine by the Object Auditor.

Closes-Bug: #1805539
Change-Id: Ic2e29474505426dea77e178bf94d891f150d851b
This commit is contained in:
arzhna 2018-11-28 11:15:05 +09:00
parent e58dce1e4e
commit eed76d8bed
1 changed files with 1 additions and 1 deletions

View File

@ -2324,7 +2324,7 @@ class BaseDiskFile(object):
@classmethod
def from_hash_dir(cls, mgr, hash_dir_path, device_path, partition, policy):
return cls(mgr, device_path, None, partition, _datadir=hash_dir_path,
return cls(mgr, device_path, partition, _datadir=hash_dir_path,
policy=policy)
def open(self, modernize=False, current_time=None):