Fix #104. Remove "enabled" from plugin manifests

This commit is contained in:
Anders Ingemann 2013-11-21 16:00:59 +01:00
parent 663b868b41
commit 71be571f93
7 changed files with 11 additions and 27 deletions

View file

@ -44,13 +44,7 @@
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^\\w+$": { "^\\w+$": {
"type": "object", "type": "object"
"properties": {
"enabled": {
"type": "boolean"
}
},
"required": ["enabled"]
} }
}, },
"additionalProperties": false "additionalProperties": false

View file

@ -57,7 +57,6 @@ class Manifest(object):
self.loaded_plugins = [] self.loaded_plugins = []
if 'plugins' in data: if 'plugins' in data:
for plugin_name, plugin_data in data['plugins'].iteritems(): for plugin_name, plugin_data in data['plugins'].iteritems():
if plugin_data['enabled']:
modname = 'plugins.{plugin_name}'.format(plugin_name=plugin_name) modname = 'plugins.{plugin_name}'.format(plugin_name=plugin_name)
plugin = __import__(modname, fromlist=['plugins']) plugin = __import__(modname, fromlist=['plugins'])
init = getattr(plugin, 'initialize', None) init = getattr(plugin, 'initialize', None)

View file

@ -32,16 +32,13 @@
}, },
"plugins": { "plugins": {
"backports": { "backports": {
"enabled": true,
"packages": [ "cloud-init" ] "packages": [ "cloud-init" ]
}, },
"user_packages": { "user_packages": {
"enabled": true,
"repo": [ "sudo" ], "repo": [ "sudo" ],
"local": [] "local": []
}, },
"sed": { "sed": {
"enabled": true,
"file": "etc/cloud/cloud.cfg", "file": "etc/cloud/cloud.cfg",
"find": "^ name: debian$", "find": "^ name: debian$",
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash" "replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"

View file

@ -32,16 +32,13 @@
}, },
"plugins": { "plugins": {
"backports": { "backports": {
"enabled": true,
"packages": [ "cloud-init" ] "packages": [ "cloud-init" ]
}, },
"user_packages": { "user_packages": {
"enabled": true,
"repo": [ "sudo" ], "repo": [ "sudo" ],
"local": [] "local": []
}, },
"sed": { "sed": {
"enabled": true,
"file": "etc/cloud/cloud.cfg", "file": "etc/cloud/cloud.cfg",
"find": "^ name: debian$", "find": "^ name: debian$",
"replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash" "replace": " name: admin\n sudo: ALL=(ALL) NOPASSWD:ALL\n shell: /bin/bash"

View file

@ -4,7 +4,6 @@ Supported formats are the one supported by qemu-img.
In the plugins section add: In the plugins section add:
"convert_image": { "convert_image": {
"enabled": true,
"format": "vdi" "format": "vdi"
} }

View file

@ -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: Plugin is defined in the manifest file, plugin section with:
"image_commands": { "image_commands": {
"enabled": true,
"commands": [ [ "touch", "/var/www/index.html" ]], "commands": [ [ "touch", "/var/www/index.html" ]],
} }

View file

@ -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: Plugin is defined in the manifest file, plugin section with:
"user_packages": { "user_packages": {
"enabled": true,
"repo": [ "apache2" ], "repo": [ "apache2" ],
"local": [ "/tmp/mypackage.deb" ] "local": [ "/tmp/mypackage.deb" ]
} }