class documentation

class DevCacheManager(object):

View In Hierarchy

Simple class for managing a cache of block device information.

Class Method RemoveCache Remove data for a dev_path.
Class Method UpdateCache Updates the cache information for a given device.
Class Method _ConvertPath Converts a /dev/name path to the cache file name.
Constant _DEV_PREFIX Undocumented
@classmethod
def RemoveCache(cls, dev_path):

Remove data for a dev_path.

This is just a wrapper over utils.io.RemoveFile with a converted path name and logging.

Parameters
dev_path:strthe pathname of the device
Returns
NoneUndocumented
@classmethod
def UpdateCache(cls, dev_path, owner, on_primary, iv_name):

Updates the cache information for a given device.

Parameters
dev_path:strthe pathname of the device
owner:strthe owner (instance name) of the device
on_primary:boolwhether this is the primary node nor not
iv_name:strthe instance-visible name of the device, as in objects.Disk.iv_name
Returns
NoneUndocumented
@classmethod
def _ConvertPath(cls, dev_path):

Converts a /dev/name path to the cache file name.

This replaces slashes with underscores and strips the /dev prefix. It then returns the full path to the cache file.

Parameters
dev_path:strthe /dev/ path name
Returns
strthe converted path name
_DEV_PREFIX: str =

Undocumented

Value
'/dev/'