def init(self, no_stats=False, only_mount=None):

        logger.debug("Initializing volume {0}".format(self))
        if self.stats and not no_stats:
            self.fill_stats()

        if not self._should_mount(only_mount):
            yield self
            return

        if self.flag != 'alloc':
            return

        logger.info("Mounting volume {0}".format(self))
        self.mount()

        if self.stats and not no_stats:
            self.detect_mountpoint()

        if not self.volumes:
            yield self
        else:
            for v in self.volumes:
                for s in v.init():
                    yield s
Generator that mounts this volume and either yields itself or recursively generates its subvolumes.
dataset/ETHPy150Open ralphje/imagemounter/imagemounter/volume.py/Volume.init