Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
A new way to decide if the type is string instead of by isinstance
Browse files Browse the repository at this point in the history
py3 doesn't support basestring, so we need a new way to decide if
the type of an object is string. The module 'six' could
help us: isinstance(var, six.string_types).
Reference: amnong/easywebdav#26

Change-Id: I79266a3c5612d3b7cbe7c94d71d8f5a6aa7c03ab
  • Loading branch information
hychuang authored and jichenjc committed Dec 16, 2015
1 parent 31f6e32 commit ff37316
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nova/virt/zvm/volumeop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import contextlib
import re
import six
import time

from oslo_config import cfg
Expand Down Expand Up @@ -713,7 +714,7 @@ def _extract_connection_info(self, context, connection_info):
self._format_fcp_list(fcp_list))

def _format_wwpn(self, wwpn):
if isinstance(wwpn, basestring):
if isinstance(wwpn, six.string_types):
return wwpn.lower()
else:
new_wwpn = ';'.join(wwpn)
Expand Down

0 comments on commit ff37316

Please sign in to comment.