Merge lp:~jtv/maas/bug-1300587 into lp:~maas-committers/maas/trunk

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 2218
Proposed branch: lp:~jtv/maas/bug-1300587
Merge into: lp:~maas-committers/maas/trunk
Prerequisite: lp:~jtv/maas/bug-1295479
Diff against target: 208 lines (+12/-69)
7 files modified
src/maasserver/forms.py (+0/-1)
src/maasserver/forms_settings.py (+4/-19)
src/maasserver/models/config.py (+1/-5)
src/maasserver/models/nodegroup.py (+6/-12)
src/maasserver/models/tests/test_nodegroup.py (+0/-26)
src/maasserver/views/tests/test_settings.py (+0/-4)
src/provisioningserver/tasks.py (+1/-2)
To merge this branch: bzr merge lp:~jtv/maas/bug-1300587
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+213599@code.launchpad.net

This proposal supersedes a proposal from 2014-04-01.

Commit message

Remove the cloud_images_archive setting, which has become unused. And, stop passing the archive settings to the import script: it only cares about Simplestreams sources now, not archive URLs.

Description of the change

In addition, this cleans up three settings that were completely unused: fallback_master_archive, keep_mirror_list_uptodate, and fetch_new_releases.

Also, the "OS release" setting belonged in the Ubuntu section of the config, not the Network section.

Jeroen

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/forms.py'
2--- src/maasserver/forms.py 2014-03-26 02:33:14 +0000
3+++ src/maasserver/forms.py 2014-04-01 06:56:44 +0000
4@@ -833,7 +833,6 @@
5 default_distro_series = get_config_field('default_distro_series')
6 main_archive = get_config_field('main_archive')
7 ports_archive = get_config_field('ports_archive')
8- cloud_images_archive = get_config_field('cloud_images_archive')
9
10
11 class GlobalKernelOptsForm(ConfigForm):
12
13=== modified file 'src/maasserver/forms_settings.py'
14--- src/maasserver/forms_settings.py 2014-03-17 15:15:53 +0000
15+++ src/maasserver/forms_settings.py 2014-04-01 06:56:44 +0000
16@@ -47,9 +47,6 @@
17 'label': "Check component compatibility and certification"
18 }
19 },
20- #'fallback_master_archive': {},
21- #'keep_mirror_list_uptodate': {},
22- #'fetch_new_releases': {},
23 'main_archive': {
24 'default': 'http://archive.ubuntu.com/ubuntu',
25 'form': forms.URLField,
26@@ -57,8 +54,8 @@
27 'label': "Main archive",
28 'error_messages': {'invalid': INVALID_URL_MESSAGE},
29 'help_text': (
30- "Archive used by nodes to retrieve packages and by cluster "
31- "controllers to retrieve boot images (Intel architectures). "
32+ "Archive used by nodes to retrieve packages for Intel "
33+ "architectures. "
34 "E.g. http://archive.ubuntu.com/ubuntu."
35 )
36 }
37@@ -70,24 +67,12 @@
38 'label': "Ports archive",
39 'error_messages': {'invalid': INVALID_URL_MESSAGE},
40 'help_text': (
41- "Archive used by cluster controllers to retrieve boot "
42- "images (non-Intel architectures). "
43+ "Archive used by nodes to retrieve packages for non-Intel "
44+ "architectures. "
45 "E.g. http://ports.ubuntu.com/ubuntu-ports."
46 )
47 }
48 },
49- 'cloud_images_archive': {
50- 'default': 'https://maas.ubuntu.com/images',
51- 'form': forms.URLField,
52- 'form_kwargs': {
53- 'label': "Cloud images archive",
54- 'error_messages': {'invalid': INVALID_URL_MESSAGE},
55- 'help_text': (
56- "Archive used by the nodes to retrieve ephemeral images. "
57- "E.g. https://maas.ubuntu.com/images."
58- )
59- }
60- },
61 'maas_name': {
62 'default': gethostname(),
63 'form': forms.CharField,
64
65=== modified file 'src/maasserver/models/config.py'
66--- src/maasserver/models/config.py 2014-03-24 01:22:54 +0000
67+++ src/maasserver/models/config.py 2014-04-01 06:56:44 +0000
68@@ -38,17 +38,13 @@
69 # Commissioning section configuration.
70 'check_compatibility': False,
71 # Ubuntu section configuration.
72- 'fallback_master_archive': False,
73- 'keep_mirror_list_uptodate': False,
74- 'fetch_new_releases': False,
75 'main_archive': 'http://archive.ubuntu.com/ubuntu',
76 'ports_archive': 'http://ports.ubuntu.com/ubuntu-ports',
77- 'cloud_images_archive': 'https://maas.ubuntu.com/images',
78+ 'commissioning_distro_series': DISTRO_SERIES.trusty,
79 # Network section configuration.
80 'maas_name': gethostname(),
81 'enlistment_domain': b'local',
82 'default_distro_series': DISTRO_SERIES.trusty,
83- 'commissioning_distro_series': DISTRO_SERIES.trusty,
84 'http_proxy': None,
85 'upstream_dns': None,
86 'ntp_server': '91.189.94.4', # ntp.ubuntu.com
87
88=== modified file 'src/maasserver/models/nodegroup.py'
89--- src/maasserver/models/nodegroup.py 2014-03-29 15:40:53 +0000
90+++ src/maasserver/models/nodegroup.py 2014-04-01 06:56:44 +0000
91@@ -264,19 +264,13 @@
92 """
93 # Avoid circular imports.
94 from maasserver.models import Config
95- config_parameters = {
96- 'http_proxy',
97- 'main_archive',
98- 'ports_archive',
99- 'cloud_images_archive',
100- }
101 task_kwargs = {
102- name: Config.objects.get_config(name)
103- for name in config_parameters
104- if Config.objects.get_config(name) is not None
105- }
106- task_kwargs['callback'] = report_boot_images.subtask(
107- options={'queue': self.uuid})
108+ 'callback': report_boot_images.subtask(
109+ options={'queue': self.uuid}),
110+ }
111+ http_proxy = Config.objects.get_config('http_proxy')
112+ if http_proxy is not None:
113+ task_kwargs['http_proxy'] = http_proxy
114 import_boot_images.apply_async(queue=self.uuid, kwargs=task_kwargs)
115
116 def add_seamicro15k(self, mac, username, password, power_control=None):
117
118=== modified file 'src/maasserver/models/tests/test_nodegroup.py'
119--- src/maasserver/models/tests/test_nodegroup.py 2014-03-26 14:37:21 +0000
120+++ src/maasserver/models/tests/test_nodegroup.py 2014-04-01 06:56:44 +0000
121@@ -252,14 +252,6 @@
122 for args, kwargs in recorder.apply_async.call_args_list]
123 self.assertItemsEqual(expected_queues, actual_queues)
124
125-
126-def make_archive_url(name):
127- """Create a fake archive URL."""
128- return "http://%s.example.com/%s/" % (
129- factory.make_name(name),
130- factory.make_name('path'),
131- )
132-
133 def test_refresh_workers_refreshes_accepted_cluster_controllers(self):
134 self.patch(nodegroup_module, 'refresh_worker')
135 nodegroup = factory.make_node_group(status=NODEGROUP_STATUS.ACCEPTED)
136@@ -447,24 +439,6 @@
137 (proxy, proxy),
138 (env.get('http_proxy'), env.get('https_proxy')))
139
140- def test_import_boot_images_selects_archive_locations_from_config(self):
141- recorder = self.patch(nodegroup_module, 'import_boot_images')
142- nodegroup = factory.make_node_group(status=NODEGROUP_STATUS.ACCEPTED)
143-
144- archives = {
145- 'main_archive': make_archive_url('main'),
146- 'ports_archive': make_archive_url('ports'),
147- 'cloud_images_archive': make_archive_url('cloud_images'),
148- }
149- for key, value in archives.items():
150- Config.objects.set_config(key, value)
151-
152- nodegroup.import_boot_images()
153-
154- kwargs = recorder.apply_async.call_args[1]['kwargs']
155- archive_options = {arg: kwargs.get(arg) for arg in archives}
156- self.assertEqual(archives, archive_options)
157-
158 def test_import_boot_images_sent_to_nodegroup_queue(self):
159 recorder = self.patch(nodegroup_module, 'import_boot_images')
160 nodegroup = factory.make_node_group()
161
162=== modified file 'src/maasserver/views/tests/test_settings.py'
163--- src/maasserver/views/tests/test_settings.py 2014-02-25 15:53:10 +0000
164+++ src/maasserver/views/tests/test_settings.py 2014-04-01 06:56:44 +0000
165@@ -145,7 +145,6 @@
166 self.client_log_in(as_admin=True)
167 new_main_archive = 'http://test.example.com/archive'
168 new_ports_archive = 'http://test2.example.com/archive'
169- new_cloud_images_archive = 'http://test3.example.com/archive'
170 new_default_distro_series = factory.getRandomEnum(DISTRO_SERIES)
171 response = self.client.post(
172 reverse('settings'),
173@@ -154,7 +153,6 @@
174 data={
175 'main_archive': new_main_archive,
176 'ports_archive': new_ports_archive,
177- 'cloud_images_archive': new_cloud_images_archive,
178 'default_distro_series': new_default_distro_series,
179 }))
180
181@@ -163,13 +161,11 @@
182 (
183 new_main_archive,
184 new_ports_archive,
185- new_cloud_images_archive,
186 new_default_distro_series,
187 ),
188 (
189 Config.objects.get_config('main_archive'),
190 Config.objects.get_config('ports_archive'),
191- Config.objects.get_config('cloud_images_archive'),
192 Config.objects.get_config('default_distro_series'),
193 ))
194
195
196=== modified file 'src/provisioningserver/tasks.py'
197--- src/provisioningserver/tasks.py 2014-04-01 06:56:44 +0000
198+++ src/provisioningserver/tasks.py 2014-04-01 06:56:44 +0000
199@@ -446,8 +446,7 @@
200
201 @task
202 @log_exception_text
203-def import_boot_images(http_proxy=None, main_archive=None, ports_archive=None,
204- cloud_images_archive=None, callback=None):
205+def import_boot_images(http_proxy=None, callback=None):
206 env = dict(os.environ)
207 if http_proxy is not None:
208 env['http_proxy'] = http_proxy