remove use of unicode type for python 2/3 compatibility

There is no 'unicode' type under python 3. Instead of using a tuple
with str and unicode to check the type of the metric, use
six.text_type, which is set to the correct type under each version of
python.

Change-Id: Ie380ec1a982212b33ec40f651ebce159d4fac79e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 17:10:10 -04:00
parent b473f6c880
commit c42d94b532
1 changed files with 1 additions and 1 deletions

View File

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