def storageType(t): if isinstance(t, (six.text_type, six.binary_type)): t = t.upper() if t in DOMAIN_TYPES.values(): return t try: return type2name(int(t)) except: raise se.StorageDomainTypeError(str(t))
def storageType(t): if isinstance(t, types.StringTypes): t = t.upper() if t in DOMAIN_TYPES.values(): return t try: return type2name(int(t)) except: raise se.StorageDomainTypeError(str(t))