Use constants instead of literals in Huawei Driver
We judged filesystem alloctype by literals, now we change these literals to constants. Change-Id: Iaeb64ed83b4c44e3e7d150c615ad03f8b1b4ce90 Closes-Bug: #1529015
This commit is contained in:
parent
f1c096418d
commit
49761cd38a
|
@ -31,6 +31,8 @@ ACCESS_CIFS_RO = "0"
|
||||||
ERROR_CONNECT_TO_SERVER = -403
|
ERROR_CONNECT_TO_SERVER = -403
|
||||||
ERROR_UNAUTHORIZED_TO_SERVER = -401
|
ERROR_UNAUTHORIZED_TO_SERVER = -401
|
||||||
|
|
||||||
|
ALLOC_TYPE_THIN_FLAG = "1"
|
||||||
|
|
||||||
OPTS_CAPABILITIES = {
|
OPTS_CAPABILITIES = {
|
||||||
'dedupe': False,
|
'dedupe': False,
|
||||||
'compression': False,
|
'compression': False,
|
||||||
|
|
|
@ -171,7 +171,7 @@ class V3StorageConnection(driver.HuaweiBase):
|
||||||
LOG.error(err_msg)
|
LOG.error(err_msg)
|
||||||
raise exception.InvalidShare(reason=err_msg)
|
raise exception.InvalidShare(reason=err_msg)
|
||||||
|
|
||||||
if fs_info['ALLOCTYPE'] != '1':
|
if fs_info['ALLOCTYPE'] != constants.ALLOC_TYPE_THIN_FLAG:
|
||||||
err_msg = (_("Share (%s) can not be shrunk. only 'Thin' shares "
|
err_msg = (_("Share (%s) can not be shrunk. only 'Thin' shares "
|
||||||
"support shrink.")
|
"support shrink.")
|
||||||
% share_name)
|
% share_name)
|
||||||
|
|
Loading…
Reference in New Issue