Merge lp:~liv3d/maas/windows_allow_all into lp:~maas-committers/maas/trunk

Proposed by Dan Offord
Status: Rejected
Rejected by: Mike Pontillo
Proposed branch: lp:~liv3d/maas/windows_allow_all
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 29 lines (+8/-4)
1 file modified
src/provisioningserver/drivers/osystem/windows.py (+8/-4)
To merge this branch: bzr merge lp:~liv3d/maas/windows_allow_all
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Needs Information
Review via email: mp+321163@code.launchpad.net

Commit message

  Allow Windows images of any name to be valid

  There is a use case where you may want/need multiple Windows versions with
  different setups, but to still be one of the 6 currently allowed O/S.

  This change is also useful if in a specific use case the Windows build was
  dated with the date of build/last Windows Update baked in to it.

  If one of the previously allowed 6 names are used for the Windows image, it
  will still correctly give the title as expected, otherwise return the release
  name.

Description of the change

  Allow Windows images of any name to be valid

  There is a use case where you may want/need multiple Windows versions with
  different setups, but to still be one of the 6 currently allowed O/S.

  This change is also useful if in a specific use case the Windows build was
  dated with the date of build/last Windows Update baked in to it.

  If one of the previously allowed 6 names are used for the Windows image, it
  will still correctly give the title as expected, otherwise return the release
  name.

To post a comment you must log in.
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Thanks for your contribution. Unfortunately there is legal due diligence that must happen first. Would you please follow the instructions here?

    https://www.ubuntu.com/legal/contributors

We would be happy to consider your contributions after the agreement is in place.

As for the code, I'm confused about the requirement here. It looks like some validation is being bypassed here for Windows images, and it's not clear to me what the side effects might be. I read your commit message, but still don't fully understand. So a couple things we'll need to happen before we consider this change:

 - Please add additional comments to the code indicating why the is_release_supported() check is being bypassed. (It's not clear to me what side effects this might have.)

 - Please add unit tests for this change in order to prevent regressions (and, again, better capture the requirement).

review: Needs Information
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Moving to "Rejected" due to lack of activity. We would be happy to consider this patch (given that the above concerns are addressed) or talk about other ways to meet your requirements. Let us know.

Unmerged revisions

5866. By Dan Offord <email address hidden>

Allow Windows images of any name to be valid

There is a use case where you may want/need multiple Windows versions with
different setups, but to still be one of the 6 currently allowed O/S.

This change is also useful if in a specific use case the Windows build was
dated with the date of build/last Windows Update baked in to it.

If one of the previously allowed 6 names are used for the Windows image, it
will still correctly give the title as expected, otherwise return the release
name.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/drivers/osystem/windows.py'
2--- src/provisioningserver/drivers/osystem/windows.py 2017-02-17 14:23:04 +0000
3+++ src/provisioningserver/drivers/osystem/windows.py 2017-03-28 10:48:49 +0000
4@@ -56,8 +56,9 @@
5 return purposes
6
7 def is_release_supported(self, release):
8- """Return True when the release is supported, False otherwise."""
9- return release in WINDOWS_CHOICES
10+ """ To allow for customised Windows images, always return True. If we
11+ know about the release return the title below."""
12+ return True
13
14 def get_default_release(self):
15 """Gets the default release to use when a release is not
16@@ -65,8 +66,11 @@
17 return WINDOWS_DEFAULT
18
19 def get_release_title(self, release):
20- """Return the title for the given release."""
21- return WINDOWS_CHOICES.get(release)
22+ """Return the title for the given release, if known otherwise return
23+ the release."""
24+ if release in WINDOWS_CHOICES:
25+ return WINDOWS_CHOICES.get(release)
26+ return release
27
28 def requires_license_key(self, release):
29 return release in REQUIRE_LICENSE_KEY