applications: add explicit call to notify after new variables (#83979)
gitea/hobo/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-11-27 15:37:29 +01:00
parent cd20f86100
commit edcd930dee
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,7 @@ from django.utils.text import slugify
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
from hobo.deploy.signals import notify_agents
from hobo.environment.models import Variable
from hobo.environment.utils import get_installed_services
@ -464,6 +465,7 @@ class Version(models.Model):
return None
def deploy_parameters(self, bundle):
had_parameters = False
tar_io = io.BytesIO(bundle)
with tarfile.open(fileobj=tar_io) as tar:
manifest = json.loads(tar.extractfile('manifest.json').read().decode())
@ -480,6 +482,10 @@ class Version(models.Model):
)
variable.label = parameter.get('label')
variable.save()
had_parameters = True
if had_parameters:
notify_agents(None)
def deploy_roles(self, bundle):
tar_io = io.BytesIO(bundle)