def test_extend_volumes(self):
        prov1 = self.mox.CreateMockAnything()
        prov2 = self.mox.CreateMockAnything()
        providers = [prov1, prov2]
        pack1 = self.mox.CreateMockAnything()
        pack2 = self.mox.CreateMockAnything()
        packs = [pack1, pack2]
        CONF.volumes_to_extend=[1]
        m = vds.load_vds_service()
        svc = self.mox.CreateMockAnything()
        m.AndReturn(svc)

        m = extendvolumes.ExtendVolumesPlugin._query_providers(svc)
        m.AndReturn(providers)

        for provider in providers:
            m = extendvolumes.ExtendVolumesPlugin._query_packs(provider)
            m.AndReturn(packs)
            for pack in packs:
                extendvolumes.ExtendVolumesPlugin._extend_volumes(pack,
                                                        CONF.volumes_to_extend)

        self.mox.ReplayAll()
        response = self.obj.execute(services_base.BaseMetadataService)
        self.mox.VerifyAll()
        self.assertEqual(response, (base_plugin.PLUGIN_EXECUTE_ON_NEXT_BOOT,
                                    False))
Esempio n. 2
0
    def execute(self, service):
        svc = vds.load_vds_service()
        providers = self._query_providers(svc)

        volumes_to_extend = self._get_volumes_to_extend()

        for provider in providers:
            packs = self._query_packs(provider)
            for pack in packs:
                self._extend_volumes(pack, volumes_to_extend)
    def execute(self, service):
        svc = vds.load_vds_service()
        providers = self._query_providers(svc)

        volumes_to_extend = self._get_volumes_to_extend()

        for provider in providers:
            packs = self._query_packs(provider)
            for pack in packs:
                self._extend_volumes(pack, volumes_to_extend)

        return (base.PLUGIN_EXECUTE_ON_NEXT_BOOT, False)
    def execute(self, service):
        svc = vds.load_vds_service()
        providers = self._query_providers(svc)

        volumes_to_extend = self._get_volumes_to_extend()

        for provider in providers:
            packs = self._query_packs(provider)
            for pack in packs:
                self._extend_volumes(pack, volumes_to_extend)

        return (base.PLUGIN_EXECUTE_ON_NEXT_BOOT, False)