Skip to content

Commit 230235b

Browse files
author
Gabriel Monroy
committed
Merge pull request #2281 from gabrtv/fix-domain-remove
fix(controller): handle partial deletion of domains
2 parents ea0f066 + 6289188 commit 230235b

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)