Merge lp:~andreserl/maas/distro_series_support into lp:maas/trunk
| Status: | Merged |
|---|---|
| Approved by: | Andres Rodriguez on 2012-09-19 |
| Approved revision: | 1025 |
| Merged at revision: | 1026 |
| Proposed branch: | lp:~andreserl/maas/distro_series_support |
| Merge into: | lp:maas/trunk |
| Prerequisite: | lp:~andreserl/maas/add_node_distro_series |
| Diff against target: |
244 lines (+54/-20) 7 files modified
src/maasserver/api.py (+6/-3) src/maasserver/forms.py (+13/-0) src/maasserver/models/config.py (+6/-1) src/maasserver/models/node.py (+11/-0) src/maasserver/preseed.py (+12/-16) src/maasserver/templates/maasserver/snippets.html (+4/-0) src/maasserver/tests/test_forms.py (+2/-0) |
| To merge this branch: | bzr merge lp:~andreserl/maas/distro_series_support |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | Needs Fixing on 2012-09-19 | ||
| John A Meinel | 2012-09-18 | Approve on 2012-09-19 | |
|
Review via email:
|
|||
Commit Message
Adds the UI changes for the Ubuntu Release, as well as the necessary support to deploy machine using the specified release.
| Andres Rodriguez (andreserl) wrote : | # |
Hi John,
Thanks for the review.
1. release parameter: I will address this in a different branch (I had planned to do it either way).
2. release='': It needs to be '' instead of None. We had agreed to default it that way as it requires a string eventually. (as you mention).
| MAAS Lander (maas-lander) wrote : | # |
Attempt to merge into lp:maas failed due to conflicts:
text conflict in src/maasserver/
- 1025. By Andres Rodriguez on 2012-09-19
-
Resolve conflict on src/maasserver/
models/ config. py
| Gavin Panella (allenap) wrote : | # |
Looks good, thank you for taking this on. I have a lot of comments,
but they're all fairly minor. However, I think [1] and [8] must be
addressed before landing (well, everything ought to be, but those are
especially important) so Needs Fixing.
[1]
In src/maasserver/
+ if node is None or node.status == NODE_STATUS.
+ series = Config.
+ else:
+ series = node.get_
In src/maasserver/
+ def get_distro_
+ """Return the distro series to install that node."""
+ if not self.distro_series or self.distro_series == DISTRO_
+ return Config.
+ else:
+ return self.distro_series
There's two levels of overriding here: get_distro_series() can return
something other than node.distro_series, and then the code in the API
view can return something else again.
I suggest putting the logic that's in the API view into
get_distro_series, and renaming the method:
def get_effective_
"""Return the distro series to install that node."""
if node is None or node.status == NODE_STATUS.
return Config.
elif not self.distro_series or self.distro_series == DISTRO_
return Config.
else:
return self.distro_series
[2]
params = KernelParameters(
- arch=arch, subarch=subarch, release=release, purpose=purpose,
+ arch=arch, subarch=subarch, release=series, purpose=purpose,
That release argument ought to be renamed. File a bug if it's too much
to do here.
[3]
Before landing, please run `make lint` and fix all warnings.
[4]
Also before landing, please run:
utilities/
and commit the changes it makes.
[5]
+ distro_series = CharField(
+ max_length=10, choices=
+ blank=True, default=None)
To avoid mix-ups between None and "", I think this should be defined
as:
distro_series = CharField(
max_length=10, choices=
blank=True, default="")
Also, a maximum length of 10 seems tight. As Django should be
selecting a VARCHAR type in PostgreSQL here, the storage will be the
same:
The storage requirement for a short string (up to 126 bytes) is 1
byte plus the actual string, ...
http://
Make it at least 20, because it's not going to make any difference to
storage or performance, and because having to change it later will be
a much bigger PITA.
[6]
+ <label for="id_
+ {{ node_form.
s/Release/Series/ ?
Also, how about showing the effective series?
[7]
+ distro_series = forms.ChoiceField(
+ choices=
+ initial=
+ label="Release",
+ error_


maybe if the variable was 'release_series' it might be more obvious how it matches the 'release=' parameter? (In general, the fact that it is sometimes called distro_series, sometimes series, sometimes release is a bit confusing.)
def get_preseed_ filenames( node, prefix='', release='', default=False):
Would it be better as 'release=None' ?
Or is that to handle: src/maasserver/ templates/ maasserver/ snippets. html wanting to have a string there.
Otherwise it looks good to me.