Пример #1
0
def read_default_ovf_settings():
    """ Reads default ovf configuration from file, returns a dictionary of settings."""
    settings = {
        "serial": {"type": "pty", "target_port": 0},
        "console": {"type": "pty", "target_port": 0},
        "graphics": {"type": "vnc", "port": -1, "autoport": "yes", "keymap": "us"},
        "interfaces": [],
        "features": [],
        "disks": []
    }
    settings.update(dict(config.clist('ovf-defaults', 'kvm')))
    if not os.path.exists(settings.get("emulator", "")):
        settings["emulator"] = "/usr/bin/kvm"
    return settings
Пример #2
0
def read_default_ovf_settings():
    """
    Reads default ovf configuration from file, returns a dictionary of
    settings.
    """
    return dict(config.clist('ovf-defaults', 'openvz'))