Fix python3 unittests

Turns out basestring and types.NoneType go away in python3 - so just do
the logic a different way.

Change-Id: Ic447e1f3bdf3eac7335995edd4d20b15820f78f0
This commit is contained in:
Monty Taylor 2015-01-07 20:08:04 -05:00
parent 65fe04d5c2
commit 463885072a
1 changed files with 1 additions and 5 deletions

View File

@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import types
NON_CALLABLES = (basestring, bool, dict, int, list, types.NoneType)
def find_nova_addresses(addresses, ext_tag, key_name=None):
@ -127,6 +123,6 @@ def obj_to_dict(obj):
instance = {}
for key in dir(obj):
value = getattr(obj, key)
if (isinstance(value, NON_CALLABLES) and not key.startswith('_')):
if not hasattr(value, '__call__') and not key.startswith('_'):
instance[key] = value
return instance