From b03ec12c415df68f3c38d3eaf9e186032e4e3e28 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Fri, 16 May 2014 18:30:01 +0200 Subject: [PATCH] Make "stable" the salt install_source default. Fix a few indentation things --- bootstrapvz/plugins/salt/manifest-schema.json | 34 +++++++------------ bootstrapvz/plugins/salt/tasks.py | 9 ++--- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/bootstrapvz/plugins/salt/manifest-schema.json b/bootstrapvz/plugins/salt/manifest-schema.json index 82a7952..c6f12ca 100644 --- a/bootstrapvz/plugins/salt/manifest-schema.json +++ b/bootstrapvz/plugins/salt/manifest-schema.json @@ -9,30 +9,20 @@ "salt": { "type": "object", "properties": { - "master": { - "type": "string" - }, - "install_source": { - "type": "string" - }, - "version": { - "type": "string" - }, - "grains": { - "type": "object", - "patternProperties": { - "^[^\/\\0]+$": { - "type": "string" - } - }, - "minItems": 1 - } + "master": { "type": "string" }, + "install_source": { "enum": ["stable", "daily", "git"] }, + "version": { "type": "string" }, + "grains": { + "type": "object", + "patternProperties": { + "^[^\/\\0]+$": { "type": "string" } + }, + "minItems": 1 + } }, "required": ["install_source"] } - }, - "required": ["salt"] + } } - }, - "required": ["plugins"] + } } diff --git a/bootstrapvz/plugins/salt/tasks.py b/bootstrapvz/plugins/salt/tasks.py index 5a1b294..d44cbc3 100644 --- a/bootstrapvz/plugins/salt/tasks.py +++ b/bootstrapvz/plugins/salt/tasks.py @@ -34,17 +34,14 @@ class BootstrapSaltMinion(Task): # This is needed since bootstrap doesn't handle -X for debian distros properly. # We disable checking for running services at end since we do not start them. - sed_i( - bootstrap_script, 'install_debian_check_services', - "disabled_debian_check_services") + sed_i(bootstrap_script, 'install_debian_check_services', 'disabled_debian_check_services') - bootstrap_command = [ - 'chroot', info.root, 'bash', 'install_salt.sh', '-X'] + bootstrap_command = ['chroot', info.root, 'bash', 'install_salt.sh', '-X'] if 'master' in info.manifest.plugins['salt']: bootstrap_command.extend(['-A', info.manifest.plugins['salt']['master']]) - install_source = info.manifest.plugins['salt']['install_source'] + install_source = info.manifest.plugins['salt'].get('install_source', 'stable') bootstrap_command.append(install_source) if install_source == 'git' and ('version' in info.manifest.plugins['salt']):