Merge lp:~allenap/maas/remove-maas into lp:~maas-committers/maas/trunk
- remove-maas
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Gavin Panella | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 5587 | ||||
Proposed branch: | lp:~allenap/maas/remove-maas | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
397 lines (+81/-61) 17 files modified
HACKING.txt (+9/-5) Makefile (+2/-1) buildout.cfg (+2/-3) docs/conf.py (+2/-1) docs/troubleshooting.rst (+1/-1) media/README (+4/-4) services/reloader/run (+1/-1) src/maascli/cli.py (+2/-2) src/maasserver/__init__.py (+1/-1) src/maasserver/djangosettings/demo.py (+1/-1) src/maasserver/djangosettings/development.py (+1/-1) src/maasserver/djangosettings/settings.py (+3/-3) src/maasserver/djangosettings/tests/test_settings.py (+2/-2) src/maasserver/management/commands/dbupgrade.py (+46/-3) src/maasserver/management/commands/tests/test_dbupgrade.py (+4/-1) utilities/check-imports (+0/-27) utilities/remote-reinstall (+0/-4) |
||||
To merge this branch: | bzr merge lp:~allenap/maas/remove-maas | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Blake Rouse (community) | Approve | ||
Andres Rodriguez (community) | Needs Information | ||
Review via email: mp+310634@code.launchpad.net |
Commit message
Remove src/maas.
Description of the change
This fails in one test: http://
I haven't been able to figure it out yet, but I wanted to put this up in case someone else <cough>Blake<cough> would have an idea.
Blake Rouse (blake-rouse) wrote : | # |
Andres Rodriguez (andreserl) wrote : | # |
Why are we removing src/maas ?
Gavin Panella (allenap) wrote : | # |
> Why are we removing src/maas ?
It's not needed as a standalone thing, and hasn't been for a long time now. It also gets in the way of using "maas" as a namespace package, a change Blake has kicked off with the client API.
Gavin Panella (allenap) wrote : | # |
> I will have to dig into this to see why its failing. It has to be something in
> the tarball that is used for upgrading pre 2.0.
Thanks. I did make one change to the tarball: I added maas19settings.py. You'll get this when pulling this branch, but it won't show up in the diff, so I've pasted it too: http://
Andres Rodriguez (andreserl) wrote : | # |
This would need a lot of changes on the installation. src/maas gets up installed in /usr/share/maas and would break all installations....
Gavin Panella (allenap) wrote : | # |
> This would need a lot of changes on the installation. src/maas gets up
> installed in /usr/share/maas and would break all installations....
A packaging change is needed, yes, but /usr/share/
Gavin Panella (allenap) wrote : | # |
Okay, this is working now: I had missed out SOUTH_MIGRATION
Gavin Panella (allenap) wrote : | # |
Packaging change in lp:~allenap/maas/packaging.remove-maas.
Blake Rouse (blake-rouse) wrote : | # |
This is good work. Glad to see that folder in the code removed.
Preview Diff
1 | === modified file 'HACKING.txt' | |||
2 | --- HACKING.txt 2016-03-28 13:54:47 +0000 | |||
3 | +++ HACKING.txt 2016-12-02 09:29:56 +0000 | |||
4 | @@ -138,8 +138,9 @@ | |||
5 | 138 | regiond.log. To enable logging of all exceptions even exceptions where MAAS | 138 | regiond.log. To enable logging of all exceptions even exceptions where MAAS |
6 | 139 | will return the correct HTTP status code.:: | 139 | will return the correct HTTP status code.:: |
7 | 140 | 140 | ||
10 | 141 | $ sudo sed -i 's/DEBUG = False/DEBUG = True/g' /usr/share/maas/maas/settings.py | 141 | $ sudo sed -i 's/DEBUG = False/DEBUG = True/g' \ |
11 | 142 | $ sudo service maas-regiond restart | 142 | > /usr/lib/python3/dist-packages/maasserver/djangosettings/settings.py |
12 | 143 | $ sudo service maas-regiond restart | ||
13 | 143 | 144 | ||
14 | 144 | Run regiond in foreground | 145 | Run regiond in foreground |
15 | 145 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | 146 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
16 | @@ -149,8 +150,10 @@ | |||
17 | 149 | placed a breakpoint into the code you want to inspect you can start the regiond | 150 | placed a breakpoint into the code you want to inspect you can start the regiond |
18 | 150 | process in the foreground.:: | 151 | process in the foreground.:: |
19 | 151 | 152 | ||
22 | 152 | $ sudo service maas-regiond stop | 153 | $ sudo service maas-regiond stop |
23 | 153 | $ sudo -u maas -H DJANGO_SETTINGS_MODULE=maas.settings PYTHONPATH=/usr/share/maas twistd3 --nodaemon --pidfile= maas-regiond | 154 | $ sudo -u maas -H \ |
24 | 155 | > DJANGO_SETTINGS_MODULE=maasserver.djangosettings.settings \ | ||
25 | 156 | > twistd3 --nodaemon --pidfile= maas-regiond | ||
26 | 154 | 157 | ||
27 | 155 | 158 | ||
28 | 156 | .. Note:: | 159 | .. Note:: |
29 | @@ -175,7 +178,8 @@ | |||
30 | 175 | Development MAAS server setup | 178 | Development MAAS server setup |
31 | 176 | ============================= | 179 | ============================= |
32 | 177 | 180 | ||
34 | 178 | Access to the database is configured in ``src/maas/development.py``. | 181 | Access to the database is configured in |
35 | 182 | ``src/maasserver/djangosettings/development.py``. | ||
36 | 179 | 183 | ||
37 | 180 | The ``Makefile`` or the test suite sets up a development database | 184 | The ``Makefile`` or the test suite sets up a development database |
38 | 181 | cluster inside your branch. It lives in the ``db`` directory, which | 185 | cluster inside your branch. It lives in the ``db`` directory, which |
39 | 182 | 186 | ||
40 | === modified file 'Makefile' | |||
41 | --- Makefile 2016-10-17 06:38:56 +0000 | |||
42 | +++ Makefile 2016-12-02 09:29:56 +0000 | |||
43 | @@ -427,7 +427,8 @@ | |||
44 | 427 | $(warning 'distclean' is deprecated; use 'clean') | 427 | $(warning 'distclean' is deprecated; use 'clean') |
45 | 428 | 428 | ||
46 | 429 | harness: bin/maas-region bin/database | 429 | harness: bin/maas-region bin/database |
48 | 430 | $(dbrun) bin/maas-region shell --settings=maas.demo | 430 | $(dbrun) bin/maas-region shell \ |
49 | 431 | --settings=maasserver.djangosettings.demo | ||
50 | 431 | 432 | ||
51 | 432 | dbharness: bin/database | 433 | dbharness: bin/database |
52 | 433 | bin/database --preserve shell | 434 | bin/database --preserve shell |
53 | 434 | 435 | ||
54 | === modified file 'buildout.cfg' | |||
55 | --- buildout.cfg 2016-10-12 15:26:17 +0000 | |||
56 | +++ buildout.cfg 2016-12-02 09:29:56 +0000 | |||
57 | @@ -104,7 +104,7 @@ | |||
58 | 104 | twistd.region=twisted.scripts.twistd:run | 104 | twistd.region=twisted.scripts.twistd:run |
59 | 105 | initialization = | 105 | initialization = |
60 | 106 | ${common:initialization} | 106 | ${common:initialization} |
62 | 107 | environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.development") | 107 | environ.setdefault("DJANGO_SETTINGS_MODULE", "maasserver.djangosettings.development") |
63 | 108 | scripts = | 108 | scripts = |
64 | 109 | maas-region | 109 | maas-region |
65 | 110 | twistd.region | 110 | twistd.region |
66 | @@ -129,7 +129,6 @@ | |||
67 | 129 | # "--with-resources", | 129 | # "--with-resources", |
68 | 130 | "--with-scenarios", | 130 | "--with-scenarios", |
69 | 131 | "--with-select", | 131 | "--with-select", |
70 | 132 | "--select-dir=src/maas", | ||
71 | 133 | "--select-dir=src/maasserver", | 132 | "--select-dir=src/maasserver", |
72 | 134 | "--select-dir=src/metadataserver", | 133 | "--select-dir=src/metadataserver", |
73 | 135 | "--cover-package=maas,maasserver,metadataserver", | 134 | "--cover-package=maas,maasserver,metadataserver", |
74 | @@ -294,7 +293,7 @@ | |||
75 | 294 | from os import environ | 293 | from os import environ |
76 | 295 | environ.setdefault("MAAS_RACK_DEVELOP", "TRUE") | 294 | environ.setdefault("MAAS_RACK_DEVELOP", "TRUE") |
77 | 296 | environ.setdefault("MAAS_ROOT", "${buildout:directory}/run-e2e") | 295 | environ.setdefault("MAAS_ROOT", "${buildout:directory}/run-e2e") |
79 | 297 | environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.development") | 296 | environ.setdefault("DJANGO_SETTINGS_MODULE", "maasserver.djangosettings.development") |
80 | 298 | environ.setdefault("DEV_DB_NAME", "test_maas_e2e") | 297 | environ.setdefault("DEV_DB_NAME", "test_maas_e2e") |
81 | 299 | environ.setdefault("MAAS_PREVENT_MIGRATIONS", "1") | 298 | environ.setdefault("MAAS_PREVENT_MIGRATIONS", "1") |
82 | 300 | 299 | ||
83 | 301 | 300 | ||
84 | === modified file 'docs/conf.py' | |||
85 | --- docs/conf.py 2016-03-28 13:54:47 +0000 | |||
86 | +++ docs/conf.py 2016-12-02 09:29:56 +0000 | |||
87 | @@ -24,7 +24,8 @@ | |||
88 | 24 | from pytz import UTC | 24 | from pytz import UTC |
89 | 25 | 25 | ||
90 | 26 | # Configure MAAS's settings. | 26 | # Configure MAAS's settings. |
92 | 27 | environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.settings") | 27 | environ.setdefault( |
93 | 28 | "DJANGO_SETTINGS_MODULE", "maasserver.djangosettings.settings") | ||
94 | 28 | 29 | ||
95 | 29 | # If extensions (or modules to document with autodoc) are in another directory, | 30 | # If extensions (or modules to document with autodoc) are in another directory, |
96 | 30 | # add these directories to sys.path here. If the directory is relative to the | 31 | # add these directories to sys.path here. If the directory is relative to the |
97 | 31 | 32 | ||
98 | === modified file 'docs/troubleshooting.rst' | |||
99 | --- docs/troubleshooting.rst 2014-09-10 16:20:31 +0000 | |||
100 | +++ docs/troubleshooting.rst 2016-12-02 09:29:56 +0000 | |||
101 | @@ -111,7 +111,7 @@ | |||
102 | 111 | always point at the local server. | 111 | always point at the local server. |
103 | 112 | #. If you are still getting "404 - Page not found" errors, check that the MAAS | 112 | #. If you are still getting "404 - Page not found" errors, check that the MAAS |
104 | 113 | web interface has been installed in the right place. There should be a file | 113 | web interface has been installed in the right place. There should be a file |
106 | 114 | present called /usr/share/maas/maas/urls.py | 114 | called ``urls.py`` in ``/usr/lib/python3/dist-packages/maasserver/djangosettings/``. |
107 | 115 | 115 | ||
108 | 116 | Debugging ephemeral image | 116 | Debugging ephemeral image |
109 | 117 | ========================= | 117 | ========================= |
110 | 118 | 118 | ||
111 | === modified file 'media/README' | |||
112 | --- media/README 2012-03-11 21:13:22 +0000 | |||
113 | +++ media/README 2016-12-02 09:29:56 +0000 | |||
114 | @@ -1,5 +1,5 @@ | |||
115 | 1 | This folder contains somewhat ephemeral things: subfolders serve as | 1 | This folder contains somewhat ephemeral things: subfolders serve as |
120 | 2 | MEDIA_ROOT for maas.demo and maas.development environments. The | 2 | MEDIA_ROOT for maasserver.djangosettings.demo and .development |
121 | 3 | media/demo directory should always exist and not be deleted, though | 3 | environments. The media/demo directory should always exist and not be |
122 | 4 | its contents can be. The media/development directory should be created | 4 | deleted, though its contents can be. The media/development directory |
123 | 5 | and destroyed by tests, as needed. | 5 | should be created and destroyed by tests, as needed. |
124 | 6 | 6 | ||
125 | === modified file 'services/reloader/run' | |||
126 | --- services/reloader/run 2016-05-11 19:01:48 +0000 | |||
127 | +++ services/reloader/run 2016-12-02 09:29:56 +0000 | |||
128 | @@ -128,7 +128,7 @@ | |||
129 | 128 | exclude_filter=lambda path: ( | 128 | exclude_filter=lambda path: ( |
130 | 129 | "/test/" in path or "/testing/" in path or "/." in path)) | 129 | "/test/" in path or "/testing/" in path or "/." in path)) |
131 | 130 | wm.add_watch( | 130 | wm.add_watch( |
133 | 131 | ["src/maas*", "src/meta*"], TRIGGER_EVENTS, | 131 | ["src/maasserver", "src/metadataserver"], TRIGGER_EVENTS, |
134 | 132 | proc_fun=handle_maas_change, rec=True, auto_add=True, do_glob=True) | 132 | proc_fun=handle_maas_change, rec=True, auto_add=True, do_glob=True) |
135 | 133 | wm.add_watch( | 133 | wm.add_watch( |
136 | 134 | ["src/prov*"], TRIGGER_EVENTS, proc_fun=handle_pserv_change, | 134 | ["src/prov*"], TRIGGER_EVENTS, proc_fun=handle_pserv_change, |
137 | 135 | 135 | ||
138 | === modified file 'src/maascli/cli.py' | |||
139 | --- src/maascli/cli.py 2016-07-30 01:17:54 +0000 | |||
140 | +++ src/maascli/cli.py 2016-12-02 09:29:56 +0000 | |||
141 | @@ -189,8 +189,8 @@ | |||
142 | 189 | # Setup and the allowed django commands into the maascli. | 189 | # Setup and the allowed django commands into the maascli. |
143 | 190 | management = get_django_management() | 190 | management = get_django_management() |
144 | 191 | if management is not None and is_maasserver_available(): | 191 | if management is not None and is_maasserver_available(): |
147 | 192 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.settings") | 192 | os.environ.setdefault( |
148 | 193 | sys.path.append('/usr/share/maas') | 193 | "DJANGO_SETTINGS_MODULE", "maasserver.djangosettings.settings") |
149 | 194 | load_regiond_commands(management, parser) | 194 | load_regiond_commands(management, parser) |
150 | 195 | 195 | ||
151 | 196 | 196 | ||
152 | 197 | 197 | ||
153 | === modified file 'src/maasserver/__init__.py' | |||
154 | --- src/maasserver/__init__.py 2016-10-20 14:45:06 +0000 | |||
155 | +++ src/maasserver/__init__.py 2016-12-02 09:29:56 +0000 | |||
156 | @@ -8,7 +8,7 @@ | |||
157 | 8 | 'DefaultViewMeta', | 8 | 'DefaultViewMeta', |
158 | 9 | 'is_master_process', | 9 | 'is_master_process', |
159 | 10 | 'logger', | 10 | 'logger', |
161 | 11 | ] | 11 | ] |
162 | 12 | 12 | ||
163 | 13 | import logging | 13 | import logging |
164 | 14 | from os import environ | 14 | from os import environ |
165 | 15 | 15 | ||
166 | === renamed directory 'src/maas' => 'src/maasserver/djangosettings' | |||
167 | === modified file 'src/maasserver/djangosettings/demo.py' | |||
168 | --- src/maas/demo.py 2016-06-07 19:59:49 +0000 | |||
169 | +++ src/maasserver/djangosettings/demo.py 2016-12-02 09:29:56 +0000 | |||
170 | @@ -5,7 +5,7 @@ | |||
171 | 5 | 5 | ||
172 | 6 | from os.path import abspath | 6 | from os.path import abspath |
173 | 7 | 7 | ||
175 | 8 | from maas import ( | 8 | from maasserver.djangosettings import ( |
176 | 9 | development, | 9 | development, |
177 | 10 | import_settings, | 10 | import_settings, |
178 | 11 | settings, | 11 | settings, |
179 | 12 | 12 | ||
180 | === modified file 'src/maasserver/djangosettings/development.py' | |||
181 | --- src/maas/development.py 2016-10-18 11:21:26 +0000 | |||
182 | +++ src/maasserver/djangosettings/development.py 2016-12-02 09:29:56 +0000 | |||
183 | @@ -7,7 +7,7 @@ | |||
184 | 7 | from os.path import abspath | 7 | from os.path import abspath |
185 | 8 | 8 | ||
186 | 9 | from formencode.validators import StringBool | 9 | from formencode.validators import StringBool |
188 | 10 | from maas import ( | 10 | from maasserver.djangosettings import ( |
189 | 11 | fix_up_databases, | 11 | fix_up_databases, |
190 | 12 | import_settings, | 12 | import_settings, |
191 | 13 | settings, | 13 | settings, |
192 | 14 | 14 | ||
193 | === modified file 'src/maasserver/djangosettings/settings.py' | |||
194 | --- src/maas/settings.py 2016-11-17 11:46:08 +0000 | |||
195 | +++ src/maasserver/djangosettings/settings.py 2016-12-02 09:29:56 +0000 | |||
196 | @@ -6,9 +6,9 @@ | |||
197 | 6 | import os | 6 | import os |
198 | 7 | 7 | ||
199 | 8 | import django.template.base | 8 | import django.template.base |
200 | 9 | from maas import fix_up_databases | ||
201 | 10 | from maas.monkey import patch_get_script_prefix | ||
202 | 11 | from maasserver.config import RegionConfiguration | 9 | from maasserver.config import RegionConfiguration |
203 | 10 | from maasserver.djangosettings import fix_up_databases | ||
204 | 11 | from maasserver.djangosettings.monkey import patch_get_script_prefix | ||
205 | 12 | 12 | ||
206 | 13 | 13 | ||
207 | 14 | def _read_timezone(tzfilename='/etc/timezone'): | 14 | def _read_timezone(tzfilename='/etc/timezone'): |
208 | @@ -265,7 +265,7 @@ | |||
209 | 265 | 265 | ||
210 | 266 | ) | 266 | ) |
211 | 267 | 267 | ||
213 | 268 | ROOT_URLCONF = 'maas.urls' | 268 | ROOT_URLCONF = 'maasserver.djangosettings.urls' |
214 | 269 | 269 | ||
215 | 270 | TEMPLATE_DIRS = ( | 270 | TEMPLATE_DIRS = ( |
216 | 271 | # Put strings here, like "/home/html/django_templates" | 271 | # Put strings here, like "/home/html/django_templates" |
217 | 272 | 272 | ||
218 | === renamed file 'src/maas/tests/test_maas.py' => 'src/maasserver/djangosettings/tests/test_settings.py' | |||
219 | --- src/maas/tests/test_maas.py 2016-06-21 10:29:11 +0000 | |||
220 | +++ src/maasserver/djangosettings/tests/test_settings.py 2016-12-02 09:29:56 +0000 | |||
221 | @@ -10,11 +10,11 @@ | |||
222 | 10 | 10 | ||
223 | 11 | from django.conf import settings | 11 | from django.conf import settings |
224 | 12 | from django.db import connections | 12 | from django.db import connections |
226 | 13 | from maas import ( | 13 | from maasserver.djangosettings import ( |
227 | 14 | find_settings, | 14 | find_settings, |
228 | 15 | import_settings, | 15 | import_settings, |
229 | 16 | ) | 16 | ) |
231 | 17 | from maas.settings import ( | 17 | from maasserver.djangosettings.settings import ( |
232 | 18 | _get_local_timezone, | 18 | _get_local_timezone, |
233 | 19 | _read_timezone, | 19 | _read_timezone, |
234 | 20 | ) | 20 | ) |
235 | 21 | 21 | ||
236 | === modified file 'src/maasserver/management/commands/dbupgrade.py' | |||
237 | --- src/maasserver/management/commands/dbupgrade.py 2016-09-04 19:57:50 +0000 | |||
238 | +++ src/maasserver/management/commands/dbupgrade.py 2016-12-02 09:29:56 +0000 | |||
239 | @@ -9,6 +9,7 @@ | |||
240 | 9 | __all__ = [] | 9 | __all__ = [] |
241 | 10 | 10 | ||
242 | 11 | from importlib import import_module | 11 | from importlib import import_module |
243 | 12 | import json | ||
244 | 12 | import optparse | 13 | import optparse |
245 | 13 | import os | 14 | import os |
246 | 14 | import shutil | 15 | import shutil |
247 | @@ -34,7 +35,7 @@ | |||
248 | 34 | # Script that performs the south migrations for MAAS under django 1.6 and | 35 | # Script that performs the south migrations for MAAS under django 1.6 and |
249 | 35 | # python2.7. | 36 | # python2.7. |
250 | 36 | MAAS_UPGRADE_SCRIPT = """\ | 37 | MAAS_UPGRADE_SCRIPT = """\ |
252 | 37 | # Copyright 2015 Canonical Ltd. This software is licensed under the | 38 | # Copyright 2015-2016 Canonical Ltd. This software is licensed under the |
253 | 38 | # GNU Affero General Public License version 3 (see the file LICENSE). | 39 | # GNU Affero General Public License version 3 (see the file LICENSE). |
254 | 39 | 40 | ||
255 | 40 | from __future__ import ( | 41 | from __future__ import ( |
256 | @@ -46,12 +47,49 @@ | |||
257 | 46 | str = None | 47 | str = None |
258 | 47 | 48 | ||
259 | 48 | __metaclass__ = type | 49 | __metaclass__ = type |
262 | 49 | __all__ = [ | 50 | __all__ = [] |
261 | 50 | ] | ||
263 | 51 | 51 | ||
264 | 52 | import os | 52 | import os |
265 | 53 | import sys | 53 | import sys |
266 | 54 | 54 | ||
267 | 55 | import django.conf | ||
268 | 56 | |||
269 | 57 | |||
270 | 58 | class LazySettings(django.conf.LazySettings): | ||
271 | 59 | '''Prevent Django from mangling warnings settings. | ||
272 | 60 | |||
273 | 61 | At present, Django adds a single filter that surfaces all deprecation | ||
274 | 62 | warnings, but MAAS handles them differently. Django doesn't appear to give | ||
275 | 63 | a way to prevent it from doing its thing, so we must undo its changes. | ||
276 | 64 | |||
277 | 65 | Deprecation warnings in production environments are not desirable as they | ||
278 | 66 | are a developer tool, and not something an end user can reasonably do | ||
279 | 67 | something about. This brings control of warnings back into MAAS's control. | ||
280 | 68 | ''' | ||
281 | 69 | |||
282 | 70 | def _configure_logging(self): | ||
283 | 71 | # This is a copy of *half* of Django's `_configure_logging`, omitting | ||
284 | 72 | # the problematic bits. | ||
285 | 73 | if self.LOGGING_CONFIG: | ||
286 | 74 | from django.utils.log import DEFAULT_LOGGING | ||
287 | 75 | from django.utils.module_loading import import_by_path | ||
288 | 76 | # First find the logging configuration function ... | ||
289 | 77 | logging_config_func = import_by_path(self.LOGGING_CONFIG) | ||
290 | 78 | logging_config_func(DEFAULT_LOGGING) | ||
291 | 79 | # ... then invoke it with the logging settings | ||
292 | 80 | if self.LOGGING: | ||
293 | 81 | logging_config_func(self.LOGGING) | ||
294 | 82 | |||
295 | 83 | |||
296 | 84 | # Install our `LazySettings` as the Django-global settings class. First, | ||
297 | 85 | # ensure that Django hasn't yet loaded its settings. | ||
298 | 86 | assert not django.conf.settings.configured | ||
299 | 87 | # This is needed because Django's `LazySettings` overrides `__setattr__`. | ||
300 | 88 | object.__setattr__(django.conf.settings, "__class__", LazySettings) | ||
301 | 89 | |||
302 | 90 | # Force Django configuration. | ||
303 | 91 | os.environ["DJANGO_SETTINGS_MODULE"] = "maas19settings" | ||
304 | 92 | |||
305 | 55 | # Inject the sys.path from the parent process so that the python path is | 93 | # Inject the sys.path from the parent process so that the python path is |
306 | 56 | # is similar, except that the directory that this script is running from is | 94 | # is similar, except that the directory that this script is running from is |
307 | 57 | # already the first path in sys.path. | 95 | # already the first path in sys.path. |
308 | @@ -132,6 +170,11 @@ | |||
309 | 132 | tempdir = tempfile.mkdtemp(prefix='maas-upgrade-') | 170 | tempdir = tempfile.mkdtemp(prefix='maas-upgrade-') |
310 | 133 | subprocess.check_call([ | 171 | subprocess.check_call([ |
311 | 134 | "tar", "zxf", path_to_tarball, "-C", tempdir]) | 172 | "tar", "zxf", path_to_tarball, "-C", tempdir]) |
312 | 173 | |||
313 | 174 | settings_json = os.path.join(tempdir, "maas19settings.json") | ||
314 | 175 | with open(settings_json, "w", encoding="utf-8") as fd: | ||
315 | 176 | fd.write(json.dumps({"DATABASES": settings.DATABASES})) | ||
316 | 177 | |||
317 | 135 | script_path = os.path.join(tempdir, "migrate.py") | 178 | script_path = os.path.join(tempdir, "migrate.py") |
318 | 136 | with open(script_path, "wb") as fp: | 179 | with open(script_path, "wb") as fp: |
319 | 137 | fp.write(MAAS_UPGRADE_SCRIPT.encode("utf-8")) | 180 | fp.write(MAAS_UPGRADE_SCRIPT.encode("utf-8")) |
320 | 138 | 181 | ||
321 | === modified file 'src/maasserver/management/commands/tests/test_dbupgrade.py' | |||
322 | --- src/maasserver/management/commands/tests/test_dbupgrade.py 2016-03-28 13:54:47 +0000 | |||
323 | +++ src/maasserver/management/commands/tests/test_dbupgrade.py 2016-12-02 09:29:56 +0000 | |||
324 | @@ -64,7 +64,10 @@ | |||
325 | 64 | env = os.environ.copy() | 64 | env = os.environ.copy() |
326 | 65 | env["MAAS_PREVENT_MIGRATIONS"] = "0" | 65 | env["MAAS_PREVENT_MIGRATIONS"] = "0" |
327 | 66 | mra = os.path.join(root, "bin", "maas-region") | 66 | mra = os.path.join(root, "bin", "maas-region") |
329 | 67 | cmd = [mra, "dbupgrade", "--settings", "maas.settings"] | 67 | cmd = [ |
330 | 68 | mra, "dbupgrade", "--settings", | ||
331 | 69 | "maasserver.djangosettings.settings", | ||
332 | 70 | ] | ||
333 | 68 | if always_south: | 71 | if always_south: |
334 | 69 | cmd.append("--always-south") | 72 | cmd.append("--always-south") |
335 | 70 | self.execute(cmd, env=env) | 73 | self.execute(cmd, env=env) |
336 | 71 | 74 | ||
337 | === modified file 'src/maasserver/migrations/south/django16_south_maas19.tar.gz' | |||
338 | 72 | Binary files src/maasserver/migrations/south/django16_south_maas19.tar.gz 2016-11-17 11:46:08 +0000 and src/maasserver/migrations/south/django16_south_maas19.tar.gz 2016-12-02 09:29:56 +0000 differ | 75 | Binary files src/maasserver/migrations/south/django16_south_maas19.tar.gz 2016-11-17 11:46:08 +0000 and src/maasserver/migrations/south/django16_south_maas19.tar.gz 2016-12-02 09:29:56 +0000 differ |
339 | === modified file 'utilities/check-imports' | |||
340 | --- utilities/check-imports 2016-10-19 17:14:02 +0000 | |||
341 | +++ utilities/check-imports 2016-12-02 09:29:56 +0000 | |||
342 | @@ -263,19 +263,6 @@ | |||
343 | 263 | ) | 263 | ) |
344 | 264 | 264 | ||
345 | 265 | 265 | ||
346 | 266 | RegionControllerConfig = files("src/maas/**/*.py") | ||
347 | 267 | RegionControllerConfigRule = Rule( | ||
348 | 268 | Allow("django|django.**"), | ||
349 | 269 | Allow("formencode.validators.*"), | ||
350 | 270 | Allow("maasserver.config.*"), | ||
351 | 271 | Allow("maasserver.testing.testcase.*"), | ||
352 | 272 | Allow("maas|maas.**"), | ||
353 | 273 | Allow("provisioningserver|provisioningserver.**"), | ||
354 | 274 | Allow("psycopg2|psycopg2.**"), | ||
355 | 275 | Allow(StandardLibraries), | ||
356 | 276 | ) | ||
357 | 277 | |||
358 | 278 | |||
359 | 279 | Tests = files( | 266 | Tests = files( |
360 | 280 | "src/**/test_*.py", | 267 | "src/**/test_*.py", |
361 | 281 | "src/**/testing/**/*.py", | 268 | "src/**/testing/**/*.py", |
362 | @@ -424,20 +411,6 @@ | |||
363 | 424 | Allow(TestingLibraries), | 411 | Allow(TestingLibraries), |
364 | 425 | ), | 412 | ), |
365 | 426 | ), | 413 | ), |
366 | 427 | |||
367 | 428 | # | ||
368 | 429 | # REGION CONTROLLER CONFIGURATION | ||
369 | 430 | # | ||
370 | 431 | ( | ||
371 | 432 | RegionControllerConfig - Tests, | ||
372 | 433 | RegionControllerConfigRule, | ||
373 | 434 | ), | ||
374 | 435 | ( | ||
375 | 436 | RegionControllerConfig & Tests, | ||
376 | 437 | RegionControllerConfigRule | Rule( | ||
377 | 438 | Allow(TestingLibraries), | ||
378 | 439 | ), | ||
379 | 440 | ), | ||
380 | 441 | # | 414 | # |
381 | 442 | # TESTING HELPERS | 415 | # TESTING HELPERS |
382 | 443 | # | 416 | # |
383 | 444 | 417 | ||
384 | === modified file 'utilities/remote-reinstall' | |||
385 | --- utilities/remote-reinstall 2016-10-27 00:01:01 +0000 | |||
386 | +++ utilities/remote-reinstall 2016-12-02 09:29:56 +0000 | |||
387 | @@ -159,10 +159,6 @@ | |||
388 | 159 | root@${hostname}:/etc/maas | 159 | root@${hostname}:/etc/maas |
389 | 160 | ssh_run "chown -R maas:maas /etc/maas" | 160 | ssh_run "chown -R maas:maas /etc/maas" |
390 | 161 | 161 | ||
391 | 162 | echo " - src/maas --> /usr/share/maas/maas" | ||
392 | 163 | try rsync -${rsync_options} src/maas/ \ | ||
393 | 164 | root@${hostname}:/usr/share/maas/maas | ||
394 | 165 | |||
395 | 166 | echo "" | 162 | echo "" |
396 | 167 | echo "Synchronizing static web content..." | 163 | echo "Synchronizing static web content..." |
397 | 168 | echo " - Removing /usr/share/maas/web/static/*..." | 164 | echo " - Removing /usr/share/maas/web/static/*..." |
I will have to dig into this to see why its failing. It has to be something in the tarball that is used for upgrading pre 2.0.