]> git.ipfire.org Git - pbs.git/commitdiff
builders: Ignore start/stop commands for builders that don't support it
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 20 Jun 2022 17:15:46 +0000 (17:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 20 Jun 2022 17:15:46 +0000 (17:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/builders.py

index fa1be2e3de0fa172e129e1ecddedb6355e9bb241..6d7a304ea62cacd7d227f44ec6e6865202815866 100644 (file)
@@ -582,6 +582,10 @@ class Builder(base.DataObject):
                await asyncio.to_thread(self._start, wait=wait)
 
        def _start(self, wait):
+               # Requires an instance
+               if not self.instance:
+                       return
+
                log.info("Starting %s" % self)
 
                # Set correct instance type
@@ -634,6 +638,10 @@ class Builder(base.DataObject):
                await asyncio.to_thread(self._stop, wait=wait)
 
        def _stop(self, wait):
+               # Requires an instance
+               if not self.instance:
+                       return
+
                log.info("Stopping %s" % self)
 
                # Send the stop signal