def getChildren(self): """ Return children volume UUIDs. This API is not suitable for use with a template's base volume. """ domPath = self.imagePath.split('images')[0] metaPattern = os.path.join(domPath, 'images', self.imgUUID, '*.meta') metaPaths = oop.getProcessPool(self.sdUUID).glob.glob(metaPattern) pattern = "%s.*%s" % (volume.PUUID, self.volUUID) matches = grepCmd(pattern, metaPaths) if matches: children = [] for line in matches: volMeta = os.path.basename(line.rsplit(':', 1)[0]) children.append(os.path.splitext(volMeta)[0]) # volUUID else: children = tuple() return tuple(children)
def getChildren(self): """ Return children volume UUIDs. Children can be found in any image of the volume SD. """ domPath = self.imagePath.split('images')[0] metaPattern = os.path.join(domPath, 'images', '*', '*.meta') metaPaths = oop.getProcessPool(self.sdUUID).glob.glob(metaPattern) pattern = "%s.*%s" % (volume.PUUID, self.volUUID) matches = grepCmd(pattern, metaPaths) if matches: children = [] for line in matches: volMeta = os.path.basename(line.split(':')[0]) children.append(os.path.splitext(volMeta)[0]) # volUUID else: children = tuple() return tuple(children)