-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request deis#4394 from krancour/publish-etcd-keys-at-contr…
…oller-start feat(controller): publish etcd keys at controller start
- Loading branch information
Showing
6 changed files
with
42 additions
and
38 deletions.
There are no files selected for viewing
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions
16
controller/api/management/commands/load_db_state_to_etcd.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from api.models import Key, App, Domain, Certificate, Config | ||
|
||
|
||
class Command(BaseCommand): | ||
"""Management command for publishing Deis platform state from the database | ||
to etcd. | ||
""" | ||
def handle(self, *args, **options): | ||
"""Publishes Deis platform state from the database to etcd.""" | ||
print "Publishing DB state to etcd..." | ||
for model in (Key, App, Domain, Certificate, Config): | ||
for obj in model.objects.all(): | ||
obj.save() | ||
print "Done Publishing DB state to etcd." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters