bootstrap-vz/bootstrapvz/plugins/apt_proxy/__init__.py
Tiago Ilieve 4ba701cfad Add CheckAptProxy task
Check if the specified APT proxy server can be reached, informing the
user if this can't be done. That will help them to debug the errors that
will be raised by `apt-get` because of the misleading proxy
configuration.

This closes #95.
2014-05-23 09:51:17 -03:00

12 lines
410 B
Python

def validate_manifest(data, validator, error):
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.json'))
validator(data, schema_path)
def resolve_tasks(taskset, manifest):
import tasks
taskset.add(tasks.CheckAptProxy)
taskset.add(tasks.SetAptProxy)
if not manifest.plugins['apt_proxy'].get('persistent', False):
taskset.add(tasks.RemoveAptProxy)