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:
parent
b473f6c880
commit
c42d94b532
|
@ -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']],
|
||||
|
|
Loading…
Reference in New Issue