Merge lp:~rvb/maas-test/customize-series-arch into lp:maas-test

Proposed by Raphaël Badin
Status: Merged
Merged at revision: 66
Proposed branch: lp:~rvb/maas-test/customize-series-arch
Merge into: lp:maas-test
Diff against target: 0 lines
To merge this branch: bzr merge lp:~rvb/maas-test/customize-series-arch
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+196685@code.launchpad.net

Commit message

Add option to let the user specify the series and the architecture for which images should be imported.

Description of the change

The main change here is the change to import_maas_images() and the related change to parser.py to let the user pass parameters down to import_maas_images().

The change to test_setUp_calls_methods_if_direct_ip_set (this change http://paste.ubuntu.com/6478367/ in maastest/tests/test_maasfixture.py) is nothing but a drive-by fix: we didn't check that import_maas_images was called as part of the setup, and now we do.

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

Looks good.

[1]

+        :param series: The Ubuntu series that this MAAS server should use
+            to enlist and commission nodes.
+        :param series: The architecture that this MAAS server should import
+            images for, e.g. 'amd64', 'arm/hightbank'.  If the
+            subarchitecture isn't specified, 'generic' is assumed.

I think the second ":param series:" should be ":param architecture:".

[2]

+        :param series: The Ubuntu series for which images should be imported.
+        :param series: The architecture for which images should be imported,
+            e.g. 'amd64', 'arm/hightbank'.  If the
+            subarchitecture isn't specified, 'generic' is assumed.

Here too :)

[3]

+        if response.code != httplib.OK:
+            raise Exception("Error configure the commissiong series")

The response may have more information here. How about raising a
urllib2.HTTPError here (assuming that the underlying transport is
provided by urllib2)?

[4]

+        default=latest_LTS_series,
+        help="The Ubuntu series used to enlist and commission nodes, e.g. "
+             "saucy.  Defaults to the latest LTS series (i.e. %s)" %
+             latest_LTS_series)

You can use %(default)s in the help string, iirc:

        help="The Ubuntu series used to enlist and commission nodes, e.g. "
             "saucy.  Defaults to the latest LTS series (i.e. %(default)s)"

review: Approve
62. By Raphaël Badin

Review fixes.

63. By Raphaël Badin

Merge trunk.

64. By Raphaël Badin

Merge trunk.

Revision history for this message
Raphaël Badin (rvb) wrote :

> Looks good.

Thanks for the review!

> I think the second ":param series:" should be ":param architecture:".

Oops, fixed! x @

> [3]
>
> +        if response.code != httplib.OK:
> +            raise Exception("Error configure the commissiong series")
>
> The response may have more information here. How about raising a
> urllib2.HTTPError here (assuming that the underlying transport is
> provided by urllib2)?

The idea of using the response' content is a good one… but I'm not sure we want to raise and exception of type urllib2.HTTPError. Maybe a good trade off would be to build a custom exception using the response's content (plus a custom error message). But I'll leave it for now as this is something that we will have to fix in many places if we decide to change our strategy. I've added a TODO.

> [4]
>
> +        default=latest_LTS_series,
> +        help="The Ubuntu series used to enlist and commission nodes, e.g. "
> +             "saucy.  Defaults to the latest LTS series (i.e. %s)" %
> +             latest_LTS_series)
>
> You can use %(default)s in the help string, iirc:
>
>        help="The Ubuntu series used to enlist and commission nodes, e.g. "
>             "saucy.  Defaults to the latest LTS series (i.e. %(default)s)"

Good point, fixed.

65. By Raphaël Badin

Add TODO comment.

Preview Diff

Empty

Subscribers

People subscribed via source and target branches