Fix v1 hybrid storage python2 python3 string type comparison in memory

Comparing res_type_info['qty_metric'] against six.string_types
instead of six.text_type for python2 python3 compatibility

Change-Id: I1fc4959ff7b64210a2d47ec77dc2780b320fc355
Signed-off-by: yuanrunsen <yuanrunsen@unitedstack.com>
This commit is contained in:
yuanrunsen 2019-07-11 17:56:11 +08:00 committed by Luka Peschke
parent d78ba8740e
commit f044c03fb1

View File

@ -400,7 +400,7 @@ class GnocchiStorage(BaseHybridBackend):
price_dict = {'price': float(price)}
# Getting vol
if isinstance(res_type_info['qty_metric'], six.text_type):
if isinstance(res_type_info['qty_metric'], six.string_types):
try:
qty = self._conn.metric.get_measures(
resource['metrics'][res_type_info['qty_metric']],