From 71be571f93e9b8a952ab16740bd6114150698fb7 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Thu, 21 Nov 2013 16:00:59 +0100 Subject: [PATCH] Fix #104. Remove "enabled" from plugin manifests --- base/manifest-schema.json | 8 +------ base/manifest.py | 21 +++++++++---------- ...ebs-debian-official-i386-pvm.manifest.json | 3 --- .../ec2-ebs-debian-official.manifest.json | 3 --- plugins/convert_image/README.md | 1 - plugins/image_commands/README.md | 1 - plugins/user_packages/README.md | 1 - 7 files changed, 11 insertions(+), 27 deletions(-) diff --git a/base/manifest-schema.json b/base/manifest-schema.json index 0db594d..d9eb7c9 100644 --- a/base/manifest-schema.json +++ b/base/manifest-schema.json @@ -44,13 +44,7 @@ "type": "object", "patternProperties": { "^\\w+$": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": ["enabled"] + "type": "object" } }, "additionalProperties": false diff --git a/base/manifest.py b/base/manifest.py index df17372..0f65149 100644 --- a/base/manifest.py +++ b/base/manifest.py @@ -57,14 +57,13 @@ class Manifest(object): self.loaded_plugins = [] if 'plugins' in data: for plugin_name, plugin_data in data['plugins'].iteritems(): - if plugin_data['enabled']: - modname = 'plugins.{plugin_name}'.format(plugin_name=plugin_name) - plugin = __import__(modname, fromlist=['plugins']) - init = getattr(plugin, 'initialize', None) - if callable(init): - init() - log.debug('Loaded plugin `%s\'', plugin_name) - self.loaded_plugins.append(plugin) - validate = getattr(plugin, 'validate_manifest', None) - if callable(validate): - validate(data, self.schema_validate) + modname = 'plugins.{plugin_name}'.format(plugin_name=plugin_name) + plugin = __import__(modname, fromlist=['plugins']) + init = getattr(plugin, 'initialize', None) + if callable(init): + init() + log.debug('Loaded plugin `%s\'', plugin_name) + self.loaded_plugins.append(plugin) + validate = getattr(plugin, 'validate_manifest', None) + if callable(validate): + validate(data, self.schema_validate) diff --git a/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json b/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json index 72f03db..cec6c35 100644 --- a/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json +++ b/manifests/ec2-ebs-debian-official-i386-pvm.manifest.json @@ -32,16 +32,13 @@ }, "plugins": { "backports": { - "enabled": true, "packages": [ "cloud-init" ] }, "user_packages": { - "enabled": true, "repo": [ "sudo" ], "local": [] }, "sed": { - "enabled": true, "file": "etc/cloud/cloud.cfg", "find": "^ name: debian$", "replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash" diff --git a/manifests/ec2-ebs-debian-official.manifest.json b/manifests/ec2-ebs-debian-official.manifest.json index 730c801..29ea513 100644 --- a/manifests/ec2-ebs-debian-official.manifest.json +++ b/manifests/ec2-ebs-debian-official.manifest.json @@ -32,16 +32,13 @@ }, "plugins": { "backports": { - "enabled": true, "packages": [ "cloud-init" ] }, "user_packages": { - "enabled": true, "repo": [ "sudo" ], "local": [] }, "sed": { - "enabled": true, "file": "etc/cloud/cloud.cfg", "find": "^ name: debian$", "replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash" diff --git a/plugins/convert_image/README.md b/plugins/convert_image/README.md index 18ba070..97b4dbd 100644 --- a/plugins/convert_image/README.md +++ b/plugins/convert_image/README.md @@ -4,7 +4,6 @@ Supported formats are the one supported by qemu-img. In the plugins section add: "convert_image": { - "enabled": true, "format": "vdi" } diff --git a/plugins/image_commands/README.md b/plugins/image_commands/README.md index 7efc592..8dc0e50 100644 --- a/plugins/image_commands/README.md +++ b/plugins/image_commands/README.md @@ -5,7 +5,6 @@ This plugin gives the possibility to the user to execute commands. Plugin is defined in the manifest file, plugin section with: "image_commands": { - "enabled": true, "commands": [ [ "touch", "/var/www/index.html" ]], } diff --git a/plugins/user_packages/README.md b/plugins/user_packages/README.md index 059bf63..5f75766 100644 --- a/plugins/user_packages/README.md +++ b/plugins/user_packages/README.md @@ -5,7 +5,6 @@ This plugin gives the possibility to the user to install Debian packages in the Plugin is defined in the manifest file, plugin section with: "user_packages": { - "enabled": true, "repo": [ "apache2" ], "local": [ "/tmp/mypackage.deb" ] }