mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Fix #104. Remove "enabled" from plugin manifests
This commit is contained in:
parent
663b868b41
commit
71be571f93
7 changed files with 11 additions and 27 deletions
|
@ -44,13 +44,7 @@
|
|||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^\\w+$": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["enabled"]
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -4,7 +4,6 @@ Supported formats are the one supported by qemu-img.
|
|||
In the plugins section add:
|
||||
|
||||
"convert_image": {
|
||||
"enabled": true,
|
||||
"format": "vdi"
|
||||
}
|
||||
|
||||
|
|
|
@ -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" ]],
|
||||
}
|
||||
|
||||
|
|
|
@ -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" ]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue