From 6e2357ed86adb3e69a0c4dfc57e85fcca76bffae Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Wed, 20 Jun 2018 13:58:29 -0500 Subject: [PATCH] Infinidat: Get rid of pylint errors due to private lib Infinidat has a requirement for a vendor lib on the host which appears to include a package called 'capacity'. Its use and properties appear to be the same as the units package. When loaded and this package is not available it is set to None, such as when running tests on generic nodes. This results in pylint errors: "Module 'capacity' has no 'GiB' member" On failure to load, this aliases the units module as capacity to prevent these errors. Change-Id: Ia522b1c6d866acaa39439ca86c4a7bbfe4e0f70a --- cinder/volume/drivers/infinidat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/volume/drivers/infinidat.py b/cinder/volume/drivers/infinidat.py index 47c44154973..e8742ad73c6 100644 --- a/cinder/volume/drivers/infinidat.py +++ b/cinder/volume/drivers/infinidat.py @@ -48,7 +48,7 @@ try: from infi.dtypes import wwn import infinisdk except ImportError: - capacity = None + from oslo_utils import units as capacity infinisdk = None iqn = None wwn = None