get_instance_from_cache¶
- getmac.getmac.get_instance_from_cache(method_type, method_name)[source]¶
Get the cached instance of a named
Method.METHOD_CACHEis checked first, and if that fails, then any entries inFALLBACK_CACHEare checked. If both fail,Noneis returned.- Parameters:
method_type (
str) – what cache should be checked. Allowed values are:ip4|ip6|iface|default_ifacemethod_name (
str) – name of the method class to look for. It has to match exactly, including case (seeget_method_by_name()for a lookup that doesn’t care)
- Return type:
- Returns:
The cached method, or
Noneif the method was not found