예제 #1
0
파일: cmd.py 프로젝트: igoihman/lago
import warnings

import lago
import lago.plugins
import lago.plugins.cli
import lago.templates
from lago.config import config
from lago import (
    log_utils,
    workdir as lago_workdir,
)
from lago.utils import (in_prefix, with_logging)

LOGGER = logging.getLogger('cli')
in_lago_prefix = in_prefix(
    prefix_class=lago.prefix.Prefix,
    workdir_class=lago_workdir.Workdir,
)


@lago.plugins.cli.cli_plugin(
    help='Initialize a directory for framework deployment')
@lago.plugins.cli.cli_plugin_add_argument(
    'virt_config',
    help=(
        'Configuration of resources to deploy, json and yaml file formats '
        'are supported, takes option precedence over workdir. Will use '
        '$PWD/LagoInitFile by default. You can use any env vars in that file, '
        'inculuding the extra ones LAGO_PREFIX_PATH LAGO_WORKDIR_PATH and '
        'LAGO_INITFILE_PATH'),
    metavar='VIRT_CONFIG',
    type=os.path.abspath,
예제 #2
0
#
import logging
import os
import sys
import warnings

import lago
import ovirtlago
from lago.plugins.cli import (CLIPlugin, cli_plugin, cli_plugin_add_argument)
from lago.utils import (in_prefix, with_logging)
from lago.log_utils import LogTask
from lago.config import config as lago_config

LOGGER = logging.getLogger('ovirt-cli')
in_ovirt_prefix = in_prefix(
    prefix_class=ovirtlago.OvirtPrefix,
    workdir_class=ovirtlago.OvirtWorkdir,
)
# TODO: Remove this, and properly complain on unset config values
DISTS = ['el6', 'el7', 'fc20']


@cli_plugin(
    help=(
        'Create snapshots for all deployed resources. This command puts the '
        'storages, domains and hosts into maintenance before taking snapshot.'
    )
)
@cli_plugin_add_argument(
    'snapshot_name',
    help='Name of the snapshot to create',
    metavar='SNAPSHOT_NAME',
예제 #3
0
파일: cmd.py 프로젝트: iankko/lago
#
# Refer to the README and COPYING files for full details of the license
#
import logging
import os
import sys
import warnings

import lago
import ovirtlago
from lago.plugins.cli import (CLIPlugin, cli_plugin, cli_plugin_add_argument)
from lago.utils import (in_prefix, with_logging)

LOGGER = logging.getLogger('ovirt-cli')
in_ovirt_prefix = in_prefix(
    prefix_class=ovirtlago.OvirtPrefix,
    workdir_class=ovirtlago.OvirtWorkdir,
)
# TODO: Remove this, and properly complain on unset config values
CONF_DEFAULTS = {
    'reposync_dir': '/var/lib/lago/reposync',
    'reposync_config': (
        '/usr/share/ovirtlago/config/repos/'
        'ovirt-master-snapshot-external.repo'
    ),
}
DISTS = ['el6', 'el7', 'fc20']


@cli_plugin(
    help=(
        'Create snapshots for all deployed resources. This command puts the '
예제 #4
0
파일: cmd.py 프로젝트: didib/lago
import pkg_resources
import shutil
import sys
import warnings

import lago
import lago.config
import lago.plugins
import lago.plugins.cli
import lago.templates
from lago import (log_utils, workdir as lago_workdir, )
from lago.utils import (in_prefix, with_logging)

LOGGER = logging.getLogger('cli')
in_lago_prefix = in_prefix(
    prefix_class=lago.prefix.Prefix,
    workdir_class=lago_workdir.Workdir,
)


@lago.plugins.cli.cli_plugin(
    help='Initialize a directory for framework deployment'
)
@lago.plugins.cli.cli_plugin_add_argument(
    'virt_config',
    help=(
        'Configuration of resources to deploy, json and yaml file formats '
        'are supported, takes option precedence over workdir. Will use '
        '$PWD/LagoInitFile by default. You can use any env vars in that file, '
        'inculuding the extra ones LAGO_PREFIX_PATH LAGO_WORKDIR_PATH and '
        'LAGO_INITFILE_PATH'
    ),