From 5864665b1f1108bccd4428d757385a14798dfe17 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Wed, 14 Aug 2013 23:25:11 +0200 Subject: [PATCH] Make mirror param in manifest optional --- base/manifest-schema.json | 6 +++--- base/manifest.py | 2 ++ common/tasks/bootstrap.py | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/base/manifest-schema.json b/base/manifest-schema.json index 9d01b29..6c5627d 100644 --- a/base/manifest-schema.json +++ b/base/manifest-schema.json @@ -10,11 +10,11 @@ "type": "object", "properties": { "mount_dir": { "type": "string" }, + "mirror": { "type": "string" }, "tarball": { "type": "boolean" }, - "tarball_dir": { "type": "string" }, - "mirror": { "type": "string" } + "tarball_dir": { "type": "string" } }, - "required": ["mount_dir", "mirror"] + "required": ["mount_dir"] }, "system": { "type": "object", diff --git a/base/manifest.py b/base/manifest.py index 39986da..7aebdae 100644 --- a/base/manifest.py +++ b/base/manifest.py @@ -47,6 +47,8 @@ class Manifest(object): def parse(self, data): self.provider = data['provider'] self.bootstrapper = data['bootstrapper'] + if 'mirror' not in self.bootstrapper: + self.bootstrapper['mirror'] = 'http://http.debian.net/debian' if 'tarball' not in self.bootstrapper: self.bootstrapper['tarball'] = False if 'tarball_dir' not in self.bootstrapper and self.bootstrapper['tarball']: diff --git a/common/tasks/bootstrap.py b/common/tasks/bootstrap.py index a41d697..68ffc5f 100644 --- a/common/tasks/bootstrap.py +++ b/common/tasks/bootstrap.py @@ -13,8 +13,7 @@ def get_bootstrap_args(info): options.append('--include=' + ','.join(include)) if len(exclude) > 0: options.append('--exclude=' + ','.join(exclude)) - mirror = info.manifest.bootstrapper['mirror'] - arguments = [info.manifest.system['release'], info.root, mirror] + arguments = [info.manifest.system['release'], info.root, info.manifest.bootstrapper['mirror']] return executable, options, arguments