Skip to content

Commit 6289188

Browse files
author
Gabriel Monroy
committed
fix(controller): handle partial deletion of domains
1 parent a8965ab commit 6289188

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

controller/api/models.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,12 @@ def _etcd_publish_domains(**kwargs):
863863

864864
def _etcd_purge_domains(**kwargs):
865865
app = kwargs['instance'].app
866-
_etcd_client.delete('/deis/domains/{}'.format(app))
866+
app_domains = app.domain_set.all()
867+
if app_domains:
868+
_etcd_client.write('/deis/domains/{}'.format(app),
869+
' '.join(str(d.domain) for d in app_domains))
870+
else:
871+
_etcd_client.delete('/deis/domains/{}'.format(app))
867872

868873

869874
# Log significant app-related events

0 commit comments

Comments
 (0)