diskfile: Add some argument validation
Either all or none of account, container, and object should be provided. If we get some but not all, that's indicating some kind of a coding bug; there's a chance it may be benign, but it seems safer to fail early and loudly. Change-Id: Ia9a0ac28bde4b5dcbf6e979c131e61297577c120 Related-Change: Ic2e29474505426dea77e178bf94d891f150d851b
This commit is contained in:
parent
eed76d8bed
commit
c71bb25063
@ -2231,6 +2231,10 @@ class BaseDiskFile(object):
|
||||
self._account = account
|
||||
self._container = container
|
||||
self._obj = obj
|
||||
elif account or container or obj:
|
||||
raise ValueError(
|
||||
'Received a/c/o args %r, %r, and %r. Either none or all must '
|
||||
'be provided.' % (account, container, obj))
|
||||
else:
|
||||
# gets populated when we read the metadata
|
||||
self._name = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user