def enumerate(self):
        """Get a listing of all volumes managed by this service.

        :return: A ``Deferred`` that fires with an iterator of :class:`Volume`.
        """
        enumerating = self.pool.enumerate()

        def enumerated(filesystems):
            for filesystem in filesystems:
                # XXX It so happens that this works but it's kind of a
                # fragile way to recover the information:
                #    https://clusterhq.atlassian.net/browse/FLOC-78
                basename = filesystem.get_path().basename()
                try:
                    node_id, name = basename.split(b".", 1)
                    name = VolumeName.from_bytes(name)
                    # We convert to a UUID object for validation purposes:
                    UUID(node_id)
                except __HOLE__:
                    # ValueError may happen because:
                    # 1. We can't split on `.`.
                    # 2. We couldn't parse the UUID.
                    # 3. We couldn't parse the volume name.
                    # In any of those case it's presumably because that's
                    # not a filesystem Flocker is managing.Perhaps a user
                    # created it, so we just ignore it.
                    continue

                # Probably shouldn't yield this volume if the uuid doesn't
                # match this service's uuid.

                yield Volume(
                    node_id=node_id.decode("ascii"),
                    name=name,
                    service=self,
                    size=filesystem.size)
        enumerating.addCallback(enumerated)
        return enumerating
dataset/ETHPy150Open ClusterHQ/flocker/flocker/volume/service.py/VolumeService.enumerate