diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-17 18:57:28 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-18 18:29:25 +0100 |
commit | 097dd0c085a0aa13af929db04b7ef10e7564698f (patch) | |
tree | 1668e49df47af19e2933d1217583e0cc8405b8b9 | |
parent | a04f2f05b6aaa0d99420ad45c35a56be93445566 (diff) | |
download | morph-097dd0c085a0aa13af929db04b7ef10e7564698f.tar.gz |
Fix minor problems
-rw-r--r-- | morphlib/bins.py | 2 | ||||
-rw-r--r-- | morphlib/builder2.py | 6 | ||||
-rw-r--r-- | morphlib/builder2_tests.py | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/morphlib/bins.py b/morphlib/bins.py index 05a18b97..8fd01182 100644 --- a/morphlib/bins.py +++ b/morphlib/bins.py @@ -101,7 +101,7 @@ def create_stratum(rootdir, f, ex): tar.close() -def unpack_binary_from_file(f, dirname, ex): # pragma: no cover +def unpack_binary_from_file(f, dirname): # pragma: no cover '''Unpack a binary into a directory. The directory must exist already. diff --git a/morphlib/builder2.py b/morphlib/builder2.py index 394805c6..5b428232 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -42,12 +42,14 @@ class BuilderBase(object): ''' + assert isinstance(self.artifact.source.repo, + morphlib.cachedrepo.CachedRepo) meta = { 'artifact-name': artifact_name, 'source-name': self.artifact.source.morphology['name'], 'kind': self.artifact.source.morphology['kind'], 'description': self.artifact.source.morphology['description'], - 'repo': self.artifact.source.repo, + 'repo': self.artifact.source.repo.url, 'original_ref': self.artifact.source.original_ref, 'sha1': self.artifact.source.sha1, 'morphology': self.artifact.source.filename, @@ -222,7 +224,7 @@ class StratumBuilder(BuilderBase): self.write_metadata(destdir, artifact_name) artifact = self.new_artifact(artifact_name) with self.artifact_cache.put(artifact) as f: - morphlib.bins.create_stratum(destdir, f, ex) + morphlib.bins.create_stratum(destdir, f, None) class SystemBuilder(BuilderBase): # pragma: no cover diff --git a/morphlib/builder2_tests.py b/morphlib/builder2_tests.py index 44fffea9..53fd6711 100644 --- a/morphlib/builder2_tests.py +++ b/morphlib/builder2_tests.py @@ -43,7 +43,7 @@ class FakeSource(object): 'description': 'c', } - self.repo = 'd' + self.repo = morphlib.cachedrepo.CachedRepo('repo', 'url', 'path') self.original_ref = 'e' self.sha1 = 'f' self.filename = 'g' @@ -107,7 +107,7 @@ class BuilderBaseTests(unittest.TestCase): self.assertEqual(meta['source-name'], morphology['name']) self.assertEqual(meta['kind'], morphology['kind']) self.assertEqual(meta['description'], morphology['description']) - self.assertEqual(meta['repo'], source.repo) + self.assertEqual(meta['repo'], source.repo.url) self.assertEqual(meta['original_ref'], source.original_ref) self.assertEqual(meta['sha1'], source.sha1) self.assertEqual(meta['morphology'], source.filename) |