Comment 0 for bug 1805539

Revision history for this message
Arzhna Lee (arzhna) wrote :

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.

```
def __init__(self, mgr, device_path, partition,
             account=None, container=None, obj=None, _datadir=None,
             policy=None, use_splice=False, pipe_size=None,
             use_linkat=False, **kwargs):
```

However, in from_hash_dir() method, the order of arguments are mgr, device_path, None and partition. The partition of DiskFile is None.

```
@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,
               policy=policy)
```

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.