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:
liucheng 2016-01-06 14:26:19 +08:00
parent f1c096418d
commit 49761cd38a
2 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,8 @@ ACCESS_CIFS_RO = "0"
ERROR_CONNECT_TO_SERVER = -403
ERROR_UNAUTHORIZED_TO_SERVER = -401
ALLOC_TYPE_THIN_FLAG = "1"
OPTS_CAPABILITIES = {
'dedupe': False,
'compression': False,

View File

@ -171,7 +171,7 @@ class V3StorageConnection(driver.HuaweiBase):
LOG.error(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 "
"support shrink.")
% share_name)