LEFT | RIGHT |
(no file at all) | |
1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
2 # -*- python -*- | 2 # -*- python -*- |
3 | 3 |
4 # Copyright 2012 Canonical Ltd. This software is licensed under the | 4 # Copyright 2012 Canonical Ltd. This software is licensed under the |
5 # GNU Affero General Public License version 3 (see the file LICENSE). | 5 # GNU Affero General Public License version 3 (see the file LICENSE). |
6 | 6 |
7 import os.path | 7 import os.path |
8 from shutil import rmtree | 8 from shutil import rmtree |
9 from subprocess import CalledProcessError | 9 from subprocess import CalledProcessError |
10 import sys | 10 import sys |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if 'juju-gui-branch' in added_or_changed: | 50 if 'juju-gui-branch' in added_or_changed: |
51 if os.path.exists('juju-gui'): | 51 if os.path.exists('juju-gui'): |
52 rmtree('juju-gui') | 52 rmtree('juju-gui') |
53 gui_branch = config['juju-gui-branch'] | 53 gui_branch = config['juju-gui-branch'] |
54 if 'juju-api-branch' in added_or_changed: | 54 if 'juju-api-branch' in added_or_changed: |
55 if os.path.exists('juju'): | 55 if os.path.exists('juju'): |
56 rmtree('juju') | 56 rmtree('juju') |
57 api_branch = config['juju-api-branch'] | 57 api_branch = config['juju-api-branch'] |
58 if gui_branch or api_branch: | 58 if gui_branch or api_branch: |
59 fetch(gui_branch, api_branch) | 59 fetch(gui_branch, api_branch) |
60 build(config['command-log-file']) | 60 build(config['command-log-file'], config['ssl-cert-path']) |
61 # Restarting of the gui and api services is handled below. | 61 # Restarting of the gui and api services is handled below. |
62 | 62 |
63 # Handle changes to the improv server configuration. | 63 # Handle changes to the improv server configuration. |
64 if staging: | 64 if staging: |
65 staging_properties = set( | 65 staging_properties = set( |
66 ['staging', 'staging-environment', 'juju-api-port']) | 66 ['staging', 'staging-environment', 'juju-api-port']) |
67 staging_changed = added_or_changed & staging_properties | 67 staging_changed = added_or_changed & staging_properties |
68 if staging_changed or (api_branch is not None): | 68 if staging_changed or (api_branch is not None): |
69 if 'staging' in added_or_changed: | 69 if 'staging' in added_or_changed: |
70 # 'staging' went from False to True, so the agent server is | 70 # 'staging' went from False to True, so the agent server is |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if __name__ == '__main__': | 122 if __name__ == '__main__': |
123 log_entry() | 123 log_entry() |
124 try: | 124 try: |
125 main() | 125 main() |
126 except CalledProcessError as e: | 126 except CalledProcessError as e: |
127 log('Exception caught:') | 127 log('Exception caught:') |
128 log(e.output) | 128 log(e.output) |
129 raise | 129 raise |
130 finally: | 130 finally: |
131 log_exit() | 131 log_exit() |
LEFT | RIGHT |