else:
metadata['device_nodes'] = devname
- metadata['actuators'] = ""
+ metadata['actuators'] = None
if os.path.isdir(sysdir + "/queue/independent_access_ranges/"):
actuators = 0
while os.path.isdir(sysdir + "/queue/independent_access_ranges/" + str(actuators)):
"""
_supported_filters = [
- "paths", "size", "vendor", "model", "rotational", "limit", "all"
+ "actuators", "paths", "size", "vendor", "model", "rotational", "limit", "all"
]
def __init__(self,
+ actuators=None, # type: Optional[int]
paths=None, # type: Optional[List[str]]
model=None, # type: Optional[str]
size=None, # type: Optional[str]
"""
ephemeral drive group device specification
"""
+ self.actuators = actuators
+
#: List of Device objects for devices paths.
self.paths = [] if paths is None else [Device(path) for path in paths] # type: List[Device]
self.all = all
def validate(self, name: str) -> None:
- props = [self.model, self.vendor, self.size, self.rotational] # type: List[Any]
+ props = [self.actuators, self.model, self.vendor, self.size,
+ self.rotational] # type: List[Any]
if self.paths and any(p is not None for p in props):
raise DriveGroupValidationError(
name,
def __iter__(self):
# type: () -> Generator[Matcher, None, None]
+ if self.device_filter.actuators:
+ yield EqualityMatcher('actuators', self.device_filter.actuators)
if self.device_filter.size:
yield SizeMatcher('size', self.device_filter.size)
if self.device_filter.model: