Repository: deis/deis

Issue:
confd_settings.py template rendered with REGISTRATION_ENABLED value as true (vs. True)
Here is my failure tail:

```
deis-controller.service - deis-controller
   Loaded: loaded (/run/systemd/system/deis-controller.service; enabled-runtime)
   Active: failed (Result: exit-code) since Sat 2014-05-17 22:01:43 UTC; 6min ago
  Process: 31480 ExecStop=/usr/bin/docker rm -f deis-controller (code=exited, status=0/SUCCESS)
  Process: 30066 ExecStart=/usr/bin/docker run --name deis-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=${COREOS_PRIVATE_IPV4} --volumes-from=deis-logger deis/controller (code=exited, status=1/FAILURE)
  Process: 30048 ExecStartPre=/bin/sh -c docker inspect deis-controller >/dev/null && docker rm -f deis-controller || true (code=exited, status=0/SUCCESS)
  Process: 30020 ExecStartPre=/bin/sh -c docker history deis/controller >/dev/null || docker pull deis/controller (code=exited, status=0/SUCCESS)
 Main PID: 30066 (code=exited, status=1/FAILURE)

May 17 22:01:43 ip-172-31-0-49 docker[30066]: File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
May 17 22:01:43 ip-172-31-0-49 docker[30066]: __import__(name)
May 17 22:01:43 ip-172-31-0-49 docker[30066]: File "/app/deis/settings.py", line 317, in <module>
May 17 22:01:43 ip-172-31-0-49 docker[30066]: from confd_settings import *  # noqa
May 17 22:01:43 ip-172-31-0-49 docker[30066]: File "/templates/confd_settings.py", line 29, in <module>
May 17 22:01:43 ip-172-31-0-49 docker[30066]: REGISTRATION_ENABLED = true
May 17 22:01:43 ip-172-31-0-49 docker[30066]: NameError: name 'true' is not defined
May 17 22:01:43 ip-172-31-0-49 systemd[1]: deis-controller.service: main process exited, code=exited, status=1/FAILURE
May 17 22:01:43 ip-172-31-0-49 docker[31480]: deis-controller
May 17 22:01:43 ip-172-31-0-49 systemd[1]: Unit deis-controller.service entered failed state.
```

I guess that's because etcd in version 0.3.0 is saving True as true.

Was (etcd 0.2.0):

```
me@local ~ $ etcdctl set /foo/bar True
True
```

Now (etcd 0.3.0)

```
me@local ~ $ etcdctl set /foo/bar True
true
```

Here is the commit that changed this behavior: https://github.com/coreos/etcd/commit/42363001b48f6348ec4f30b4992e9197646777c9



Discussion:
I got the same error when I tried to setup a Deis cluster on EC2. Up to this point everything went really smoothly. 

Also getting this error.

Does someone have a recommendation on how to fix this? Is there a quick way to revert etcd while we wait for a patch?

@romansergey Is there a reason that the templating code can't figure this out? I might roll up my sleeve, fork the guy, and see if there's a simple fix.

See the discussion in #977 for the fix. It's just a patch that broke the django settings. I'll quickly send up a patch.


Resolving patch:
diff --git a/controller/templates/confd_settings.py b/controller/templates/confd_settings.py
--- a/controller/templates/confd_settings.py
+++ b/controller/templates/confd_settings.py
@@ -26,5 +26,5 @@
 DEIS_LOG_DIR = '/var/log/deis'
 
 {{ if .deis_controller_registrationEnabled }}
-REGISTRATION_ENABLED = {{ .deis_controller_registrationEnabled }}
+REGISTRATION_ENABLED = bool({{ .deis_controller_registrationEnabled }})
 {{ end }}


Test patch: