Browse Source

Merge "Remove unused use_taskmanager flag"

Zuul 2 weeks ago
parent
commit
2b4fdb03d9

+ 0
- 2
nodepool/builder.py View File

@@ -543,7 +543,6 @@ class CleanupWorker(BaseWorker):
543 543
         self._checkForZooKeeperChanges(new_config)
544 544
         provider_manager.ProviderManager.reconfigure(self._config, new_config,
545 545
                                                      self._zk,
546
-                                                     use_taskmanager=False,
547 546
                                                      only_image_manager=True)
548 547
         self._config = new_config
549 548
 
@@ -988,7 +987,6 @@ class UploadWorker(BaseWorker):
988 987
         self._checkForZooKeeperChanges(new_config)
989 988
         provider_manager.ProviderManager.reconfigure(self._config, new_config,
990 989
                                                      self._zk,
991
-                                                     use_taskmanager=False,
992 990
                                                      only_image_manager=True)
993 991
         self._config = new_config
994 992
 

+ 1
- 1
nodepool/cmd/nodepoolcmd.py View File

@@ -250,7 +250,7 @@ class NodePoolCmd(NodepoolApp):
250 250
                       (node.provider, node.id))
251 251
                 return
252 252
             provider = self.pool.config.providers[node.provider]
253
-            manager = provider_manager.get_provider(provider, True)
253
+            manager = provider_manager.get_provider(provider)
254 254
             manager.start(self.zk)
255 255
             launcher.NodeDeleter.delete(self.zk, manager, node)
256 256
             manager.stop()

+ 1
- 5
nodepool/driver/__init__.py View File

@@ -120,14 +120,10 @@ class Driver(object, metaclass=abc.ABCMeta):
120 120
         pass
121 121
 
122 122
     @abc.abstractmethod
123
-    def getProvider(self, provider_config, use_taskmanager):
123
+    def getProvider(self, provider_config):
124 124
         """Return a Provider instance
125 125
 
126 126
         :arg dict provider_config: A ProviderConfig instance
127
-
128
-        :arg bool use_taskmanager: Whether this provider should use a
129
-           task manager (i.e., perform synchronous or asynchronous
130
-           operations).
131 127
         """
132 128
         pass
133 129
 

+ 2
- 2
nodepool/driver/aws/__init__.py View File

@@ -23,5 +23,5 @@ class AwsDriver(Driver):
23 23
     def getProviderConfig(self, provider):
24 24
         return AwsProviderConfig(self, provider)
25 25
 
26
-    def getProvider(self, provider_config, use_taskmanager):
27
-        return AwsProvider(provider_config, use_taskmanager)
26
+    def getProvider(self, provider_config):
27
+        return AwsProvider(provider_config)

+ 2
- 2
nodepool/driver/fake/__init__.py View File

@@ -30,5 +30,5 @@ class FakeDriver(Driver):
30 30
     def getProviderConfig(self, provider):
31 31
         return FakeProviderConfig(self, provider)
32 32
 
33
-    def getProvider(self, provider_config, use_taskmanager):
34
-        return FakeProvider(provider_config, use_taskmanager)
33
+    def getProvider(self, provider_config):
34
+        return FakeProvider(provider_config)

+ 2
- 2
nodepool/driver/fake/provider.py View File

@@ -364,11 +364,11 @@ class FakeLaunchAndDeleteFailCloud(FakeOpenStackCloud):
364 364
 class FakeProvider(OpenStackProvider):
365 365
     fake_cloud = FakeOpenStackCloud
366 366
 
367
-    def __init__(self, provider, use_taskmanager):
367
+    def __init__(self, provider):
368 368
         self.createServer_fails = 0
369 369
         self.createServer_fails_with_external_id = 0
370 370
         self.__client = FakeProvider.fake_cloud()
371
-        super(FakeProvider, self).__init__(provider, use_taskmanager)
371
+        super(FakeProvider, self).__init__(provider)
372 372
 
373 373
     def _getClient(self):
374 374
         return self.__client

+ 2
- 2
nodepool/driver/kubernetes/__init__.py View File

@@ -30,5 +30,5 @@ class KubernetesDriver(Driver):
30 30
     def getProviderConfig(self, provider):
31 31
         return KubernetesProviderConfig(self, provider)
32 32
 
33
-    def getProvider(self, provider_config, use_taskmanager):
34
-        return KubernetesProvider(provider_config, use_taskmanager)
33
+    def getProvider(self, provider_config):
34
+        return KubernetesProvider(provider_config)

+ 2
- 2
nodepool/driver/openshift/__init__.py View File

@@ -33,5 +33,5 @@ class OpenshiftDriver(Driver):
33 33
     def getProviderConfig(self, provider):
34 34
         return OpenshiftProviderConfig(self, provider)
35 35
 
36
-    def getProvider(self, provider_config, use_taskmanager):
37
-        return OpenshiftProvider(provider_config, use_taskmanager)
36
+    def getProvider(self, provider_config):
37
+        return OpenshiftProvider(provider_config)

+ 2
- 2
nodepool/driver/openstack/__init__.py View File

@@ -30,5 +30,5 @@ class OpenStackDriver(Driver):
30 30
     def getProviderConfig(self, provider):
31 31
         return OpenStackProviderConfig(self, provider)
32 32
 
33
-    def getProvider(self, provider_config, use_taskmanager):
34
-        return OpenStackProvider(provider_config, use_taskmanager)
33
+    def getProvider(self, provider_config):
34
+        return OpenStackProvider(provider_config)

+ 1
- 1
nodepool/driver/openstack/provider.py View File

@@ -41,7 +41,7 @@ MAX_QUOTA_AGE = 5 * 60  # How long to keep the quota information cached
41 41
 class OpenStackProvider(Provider):
42 42
     log = logging.getLogger("nodepool.driver.openstack.OpenStackProvider")
43 43
 
44
-    def __init__(self, provider, use_taskmanager):
44
+    def __init__(self, provider):
45 45
         self.provider = provider
46 46
         self._images = {}
47 47
         self._networks = {}

+ 2
- 2
nodepool/driver/static/__init__.py View File

@@ -21,5 +21,5 @@ class StaticDriver(Driver):
21 21
     def getProviderConfig(self, provider):
22 22
         return config.StaticProviderConfig(provider)
23 23
 
24
-    def getProvider(self, provider_config, use_taskmanager):
25
-        return provider.StaticNodeProvider(provider_config, use_taskmanager)
24
+    def getProvider(self, provider_config):
25
+        return provider.StaticNodeProvider(provider_config)

+ 1
- 1
nodepool/driver/test/__init__.py View File

@@ -21,5 +21,5 @@ class TestDriver(Driver):
21 21
     def getProviderConfig(self, provider):
22 22
         return config.TestConfig(provider)
23 23
 
24
-    def getProvider(self, provider_config, use_taskmanager):
24
+    def getProvider(self, provider_config):
25 25
         return provider.TestProvider(provider_config)

+ 4
- 6
nodepool/provider_manager.py View File

@@ -21,16 +21,16 @@ import logging
21 21
 from nodepool.driver import Drivers
22 22
 
23 23
 
24
-def get_provider(provider, use_taskmanager):
24
+def get_provider(provider):
25 25
     driver = Drivers.get(provider.driver.name)
26
-    return driver.getProvider(provider, use_taskmanager)
26
+    return driver.getProvider(provider)
27 27
 
28 28
 
29 29
 class ProviderManager(object):
30 30
     log = logging.getLogger("nodepool.ProviderManager")
31 31
 
32 32
     @staticmethod
33
-    def reconfigure(old_config, new_config, zk_conn, use_taskmanager=True,
33
+    def reconfigure(old_config, new_config, zk_conn,
34 34
                     only_image_manager=False):
35 35
         '''
36 36
         Reconfigure the provider managers on any configuration changes.
@@ -41,7 +41,6 @@ class ProviderManager(object):
41 41
         :param Config old_config: The previously read configuration.
42 42
         :param Config new_config: The newly read configuration.
43 43
         :param ZooKeeper zk_conn: A ZooKeeper connection object.
44
-        :param bool use_taskmanager: If True, use a task manager.
45 44
         :param bool only_image_manager: If True, skip manager that do not
46 45
                     manage images. This is used by the builder process.
47 46
         '''
@@ -60,8 +59,7 @@ class ProviderManager(object):
60 59
             else:
61 60
                 ProviderManager.log.debug("Creating new ProviderManager object"
62 61
                                           " for %s" % p.name)
63
-                new_config.provider_managers[p.name] = \
64
-                    get_provider(p, use_taskmanager)
62
+                new_config.provider_managers[p.name] = get_provider(p)
65 63
                 new_config.provider_managers[p.name].start(zk_conn)
66 64
 
67 65
         for stop_manager in stop_managers:

+ 1
- 2
nodepool/tests/unit/test_sdk_integration.py View File

@@ -59,8 +59,7 @@ class TestShadeIntegration(tests.IntegrationTestCase):
59 59
 
60 60
         config = nodepool_config.loadConfig(configfile)
61 61
         self.assertIn('real-provider', config.providers)
62
-        pm = provider_manager.get_provider(
63
-            config.providers['real-provider'], use_taskmanager=True)
62
+        pm = provider_manager.get_provider(config.providers['real-provider'])
64 63
         # We need to cleanup the provider manager so that it doesn't leak a
65 64
         # thread that causes wait_for_threads in subsequent tests to fail.
66 65
         self.addCleanup(pm.stop)

Loading…
Cancel
Save