Merge lp:~andreserl/maas/lp1592666 into lp:~maas-committers/maas/trunk

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 5213
Proposed branch: lp:~andreserl/maas/lp1592666
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 46 lines (+8/-8)
2 files modified
src/maasserver/preseed.py (+1/-1)
src/maasserver/tests/test_preseed.py (+7/-7)
To merge this branch: bzr merge lp:~andreserl/maas/lp1592666
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+301350@code.launchpad.net

Commit message

Strip forward slash in the path of the archive mirror, provided that when composing the whole archive, we add the additional "/".

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

Needs a test!

review: Needs Fixing
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
=== modified file 'src/maasserver/preseed.py'
--- src/maasserver/preseed.py 2016-07-06 05:37:58 +0000
+++ src/maasserver/preseed.py 2016-07-28 14:06:19 +0000
@@ -573,7 +573,7 @@
573 and, optionally, the port.573 and, optionally, the port.
574 """574 """
575 parsed_url = urlparse(url)575 parsed_url = urlparse(url)
576 return parsed_url.netloc, parsed_url.path576 return parsed_url.netloc, parsed_url.path.lstrip("/")
577577
578578
579def get_preseed_context(osystem='', release='', rack_controller=None):579def get_preseed_context(osystem='', release='', rack_controller=None):
580580
=== modified file 'src/maasserver/tests/test_preseed.py'
--- src/maasserver/tests/test_preseed.py 2016-07-06 05:37:58 +0000
+++ src/maasserver/tests/test_preseed.py 2016-07-28 14:06:19 +0000
@@ -123,12 +123,12 @@
123123
124 def test_get_netloc_and_path(self):124 def test_get_netloc_and_path(self):
125 input_and_results = [125 input_and_results = [
126 ('http://name.domain:66/my/path', ('name.domain:66', '/my/path')),126 ('http://name.domain:66/my/path', ('name.domain:66', 'my/path')),
127 ('http://name.domain:80/my/path', ('name.domain:80', '/my/path')),127 ('http://name.domain:80/my/path', ('name.domain:80', 'my/path')),
128 ('http://name.domain/my/path', ('name.domain', '/my/path')),128 ('http://name.domain/my/path', ('name.domain', 'my/path')),
129 ('https://domain/path', ('domain', '/path')),129 ('https://domain/path', ('domain', 'path')),
130 ('http://domain:12', ('domain:12', '')),130 ('http://domain:12', ('domain:12', '')),
131 ('http://domain/', ('domain', '/')),131 ('http://domain/', ('domain', '')),
132 ('http://domain', ('domain', '')),132 ('http://domain', ('domain', '')),
133 ]133 ]
134 inputs = [input for input, _ in input_and_results]134 inputs = [input for input, _ in input_and_results]
@@ -446,9 +446,9 @@
446 self.assertEqual(446 self.assertEqual(
447 (447 (
448 parsed_main_archive.hostname,448 parsed_main_archive.hostname,
449 parsed_main_archive.path,449 parsed_main_archive.path.lstrip('/'),
450 parsed_ports_archive.hostname,450 parsed_ports_archive.hostname,
451 parsed_ports_archive.path,451 parsed_ports_archive.path.lstrip('/'),
452 ),452 ),
453 (453 (
454 context['main_archive_hostname'],454 context['main_archive_hostname'],