Merge lp:~gmb/maas/tweak into lp:~maas-committers/maas/trunk

Proposed by Graham Binns
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 2359
Proposed branch: lp:~gmb/maas/tweak
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 34 lines (+3/-3)
2 files modified
src/provisioningserver/config.py (+1/-1)
src/provisioningserver/tests/test_config.py (+2/-2)
To merge this branch: bzr merge lp:~gmb/maas/tweak
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+220689@code.launchpad.net

Commit message

Make the default value for keyring_data None rather than ''.

Previously, the default was an empty string, which meant that download_resources.download_boot_resources() would treat the empty string as the actual keyring and would ignore the keyring file in favour of it.

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

The problem is now that clearing the field might leave an empty string in place. This is a minefield.

Revision history for this message
Gavin Panella (allenap) wrote :

Oh, don't mind me, I jumped to conclusions.

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/provisioningserver/config.py'
2--- src/provisioningserver/config.py 2014-05-22 14:38:41 +0000
3+++ src/provisioningserver/config.py 2014-05-22 16:34:28 +0000
4@@ -185,7 +185,7 @@
5 if_missing="http://maas.ubuntu.com/images/ephemeral-v2/releases/")
6 keyring = String(
7 if_missing="/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg")
8- keyring_data = String(if_missing="")
9+ keyring_data = String(if_missing=None)
10 selections = ForEach(
11 ConfigBootSourceSelection,
12 if_missing=[ConfigBootSourceSelection.to_python({})])
13
14=== modified file 'src/provisioningserver/tests/test_config.py'
15--- src/provisioningserver/tests/test_config.py 2014-05-22 15:12:20 +0000
16+++ src/provisioningserver/tests/test_config.py 2014-05-22 16:34:28 +0000
17@@ -436,7 +436,7 @@
18 ),
19 'keyring': (
20 '/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg'),
21- 'keyring_data': '',
22+ 'keyring_data': None,
23 'selections': [
24 {
25 'arches': ['*'],
26@@ -461,7 +461,7 @@
27 'images/ephemeral-v2/releases/'),
28 'keyring': (
29 '/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg'),
30- 'keyring_data': '',
31+ 'keyring_data': None,
32 'selections': [
33 {
34 'arches': ['i386', 'amd64'],