Merge lp:~blake-rouse/maas/fix-1353597 into lp:maas/trunk

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: 2656
Merged at revision: 2656
Proposed branch: lp:~blake-rouse/maas/fix-1353597
Merge into: lp:maas/trunk
Diff against target: 36 lines (+14/-1)
2 files modified
src/provisioningserver/boot/powernv.py (+1/-1)
src/provisioningserver/boot/tests/test_powernv.py (+13/-0)
To merge this branch: bzr merge lp:~blake-rouse/maas/fix-1353597
Reviewer Review Type Date Requested Status
Jason Hobbs (community) Approve
Review via email: mp+229833@code.launchpad.net

Commit message

Forces the mac address in format_bootif to lower.

To post a comment you must log in.
Jason Hobbs (jason-hobbs) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/provisioningserver/boot/powernv.py'
--- src/provisioningserver/boot/powernv.py 2014-06-20 16:26:31 +0000
+++ src/provisioningserver/boot/powernv.py 2014-08-06 17:14:40 +0000
@@ -61,7 +61,7 @@
61 """Formats a mac address into the BOOTIF format, expected by61 """Formats a mac address into the BOOTIF format, expected by
62 the linux kernel."""62 the linux kernel."""
63 mac = mac.replace(':', '-')63 mac = mac.replace(':', '-')
64 mac = mac.upper()64 mac = mac.lower()
65 return '%02x-%s' % (ARP_HTYPE.ETHERNET, mac)65 return '%02x-%s' % (ARP_HTYPE.ETHERNET, mac)
6666
6767
6868
=== modified file 'src/provisioningserver/boot/tests/test_powernv.py'
--- src/provisioningserver/boot/tests/test_powernv.py 2014-07-16 14:12:13 +0000
+++ src/provisioningserver/boot/tests/test_powernv.py 2014-08-06 17:14:40 +0000
@@ -232,6 +232,19 @@
232 expected = 'BOOTIF=%s' % format_bootif(fake_mac)232 expected = 'BOOTIF=%s' % format_bootif(fake_mac)
233 self.assertIn(expected, config['execute']['APPEND'])233 self.assertIn(expected, config['execute']['APPEND'])
234234
235 def test_format_bootif_replaces_colon(self):
236 fake_mac = factory.getRandomMACAddress()
237 self.assertEqual(
238 '01-%s' % fake_mac.replace(':', '-').lower(),
239 format_bootif(fake_mac))
240
241 def test_format_bootif_makes_mac_address_lower(self):
242 fake_mac = factory.getRandomMACAddress()
243 fake_mac = fake_mac.upper()
244 self.assertEqual(
245 '01-%s' % fake_mac.replace(':', '-').lower(),
246 format_bootif(fake_mac))
247
235248
236class TestPowerNVBootMethodPathPrefix(MAASTestCase):249class TestPowerNVBootMethodPathPrefix(MAASTestCase):
237 """Tests for250 """Tests for