- OmfApi = OMFAPI(slice, host, port, password)
- key = cls._hash_api(slice, host, port)
- cls._Api[key] = OmfApi
- return OmfApi
-
- # XXX: this is not a hash :)
- # From wikipedia: "A hash function is any algorithm or subroutine that maps large data
- # sets of variable length to smaller data sets of a fixed length."
- # The idea is to apply a function to get a smaller string. Use hashlib instead.
- # e.g:
- # import hashlib
- # res = slice + "_" + host + "_" + port
- # hashlib.md5(res).hexdigest()
- #
- # XXX: change method name for 'make_key'
+ omf_api = OMFAPI(slice, host, port, password)
+ key = cls._make_key(slice, host, port, password)
+ cls._apis[key] = {}
+ cls._apis[key]['api'] = omf_api
+ cls._apis[key]['cnt'] = 1
+ return omf_api
+