Merge lp:~allenap/maas/simplestreams-moved-checksummer into lp:~maas-committers/maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 4313
Proposed branch: lp:~allenap/maas/simplestreams-moved-checksummer
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 24 lines (+7/-1)
1 file modified
src/maasserver/bootresources.py (+7/-1)
To merge this branch: bzr merge lp:~allenap/maas/simplestreams-moved-checksummer
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+272368@code.launchpad.net

Commit message

checksummer is no longer in the simplestreams.util module.

This plays it defensively and checks both the simplestreams.util and simplestreams.checksum_util modules for checksummer.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/bootresources.py'
2--- src/maasserver/bootresources.py 2015-09-24 19:48:38 +0000
3+++ src/maasserver/bootresources.py 2015-09-25 10:24:29 +0000
4@@ -114,6 +114,12 @@
5 from twisted.python import log
6
7
8+try:
9+ from simplestreams.checksum_util import checksummer
10+except ImportError:
11+ from simplestreams.util import checksummer
12+
13+
14 maaslog = get_maas_logger("bootresources")
15
16 # Used by maasserver.middleware.AccessMiddleware to allow
17@@ -669,7 +675,7 @@
18 """Writes the data from the given reader, into the object storage
19 for the given `BootResourceFile`."""
20 ident = self.get_resource_file_log_identifier(rfile)
21- cksummer = sutil.checksummer(
22+ cksummer = checksummer(
23 {'sha256': rfile.largefile.sha256})
24 maaslog.debug("Finalizing boot image %s.", ident)
25