import sys
import uuid
+from six import integer_types, string_types
+
class NetNSWrapper(object):
def __init__(self, loglevel = logging.INFO, enable_dump = False):
super(NetNSWrapper, self).__init__()
result = method(*realargs, **realkwargs)
# If the result is an object (not a base value),
- # then keep track of the object a return the object
+ # then keep track of the object and return the object
# reference (newuuid)
- if not (result is None or type(result) in [
- bool, float, long, str, int]):
+ if result is not None \
+ and not isinstance(result, (bool, float) + integer_types + string_types):
self._objects[newuuid] = result
result = newuuid