Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # This file is part of the Juju GUI, which lets users view and manage Juju | 1 # This file is part of the Juju GUI, which lets users view and manage Juju |
2 # environments within a graphical interface (https://launchpad.net/juju-gui). | 2 # environments within a graphical interface (https://launchpad.net/juju-gui). |
3 # Copyright (C) 2013 Canonical Ltd. | 3 # Copyright (C) 2013 Canonical Ltd. |
4 # | 4 # |
5 # This program is free software: you can redistribute it and/or modify it under | 5 # This program is free software: you can redistribute it and/or modify it under |
6 # the terms of the GNU Affero General Public License version 3, as published by | 6 # the terms of the GNU Affero General Public License version 3, as published by |
7 # the Free Software Foundation. | 7 # the Free Software Foundation. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, but WITHOUT | 9 # This program is distributed in the hope that it will be useful, but WITHOUT |
10 # ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | 10 # ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 return parser.error('the local provider is not currently supported') | 68 return parser.error('the local provider is not currently supported') |
69 # Update the options namespace with the new values. | 69 # Update the options namespace with the new values. |
70 options.admin_secret = admin_secret | 70 options.admin_secret = admin_secret |
71 options.env_file = env_file | 71 options.env_file = env_file |
72 options.env_type = env_type | 72 options.env_type = env_type |
73 | 73 |
74 | 74 |
75 def _configure_logging(level): | 75 def _configure_logging(level): |
76 """Set up the application logging.""" | 76 """Set up the application logging.""" |
77 root = logging.getLogger() | 77 root = logging.getLogger() |
78 if root.handlers: | 78 # Remove any previous handler on the root logger. |
bac
2013/10/16 14:51:20
A comment here explaining what you're doing would
frankban
2013/10/16 15:23:48
Done.
| |
79 for handler in root.handlers: | 79 for handler in root.handlers[:]: |
80 root.removeHandler(handler) | 80 root.removeHandler(handler) |
81 logging.basicConfig( | 81 logging.basicConfig( |
82 level=level, | 82 level=level, |
83 format=( | 83 format=( |
84 '%(asctime)s %(levelname)s ' | 84 '%(asctime)s %(levelname)s ' |
85 '%(module)s@%(funcName)s:%(lineno)d ' | 85 '%(module)s@%(funcName)s:%(lineno)d ' |
86 '%(message)s' | 86 '%(message)s' |
87 ), | 87 ), |
88 datefmt='%H:%M:%S', | 88 datefmt='%H:%M:%S', |
89 ) | 89 ) |
90 | 90 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 | 133 |
134 def run(options): | 134 def run(options): |
135 """Run the application.""" | 135 """Run the application.""" |
136 print('juju quickstart v{}'.format(version)) | 136 print('juju quickstart v{}'.format(version)) |
137 print('bootstrapping the {} environment (type: {})'.format( | 137 print('bootstrapping the {} environment (type: {})'.format( |
138 options.env_name, options.env_type)) | 138 options.env_name, options.env_type)) |
139 app.bootstrap(options.env_name) | 139 app.bootstrap(options.env_name) |
140 print('retrieving the Juju API address') | 140 print('retrieving the Juju API address') |
141 api_url = app.get_api_url(options.env_name) | 141 api_url = app.get_api_url(options.env_name) |
142 print('connecting to {}'.format(api_url)) | 142 print('connecting to {}'.format(api_url)) |
LEFT | RIGHT |