Beispiel #1
0
import fcntl
import os
import signal

from Cheetah import Template

from engine import context
from engine import db
from engine import exception
from engine import flags
from engine import log as logging
from engine import utils

FLAGS = flags.FLAGS
flags.DEFINE_string('console_xvp_conf_template',
                    utils.abspath('console/xvp.conf.template'),
                    'XVP conf template')
flags.DEFINE_string('console_xvp_conf', '/etc/xvp.conf',
                    'generated XVP conf file')
flags.DEFINE_string('console_xvp_pid', '/var/run/xvp.pid',
                    'XVP master process pid file')
flags.DEFINE_string('console_xvp_log', '/var/log/xvp.log', 'XVP log file')
flags.DEFINE_integer('console_xvp_multiplex_port', 5900,
                     'port for XVP to multiplex VNC connections on')


class XVPConsoleProxy(object):
    """Sets up XVP config, and manages XVP daemon."""
    def __init__(self):
        self.xvpconf_template = open(FLAGS.console_xvp_conf_template).read()
        self.host = FLAGS.host  # default, set by manager.
Beispiel #2
0
import tempfile

from engine import exception
from engine import flags
from engine import log as logging
from engine import utils
from engine.virt.disk import guestfs
from engine.virt.disk import loop
from engine.virt.disk import nbd

LOG = logging.getLogger('engine.compute.disk')
FLAGS = flags.FLAGS
flags.DEFINE_integer('minimum_root_size', 1024 * 1024 * 1024 * 10,
                     'minimum size in bytes of root partition')
flags.DEFINE_string('injected_network_template',
                    utils.abspath('virt/interfaces.template'),
                    'Template file for injected network')
flags.DEFINE_list('img_handlers', ['loop', 'nbd', 'guestfs'],
                    'Order of methods used to mount disk images')


# NOTE(yamahata): DEFINE_list() doesn't work because the command may
#                 include ','. For example,
#                 mkfs.ext3 -O dir_index,extent -E stride=8,stripe-width=16
#                 --label %(fs_label)s %(target)s
#
#                 DEFINE_list() parses its argument by
#                 [s.strip() for s in argument.split(self._token)]
#                 where self._token = ','
#                 No escape nor exceptional handling for ','.
#                 DEFINE_list() doesn't give us what we need.
Beispiel #3
0
flags.DEFINE_list('allowed_roles',
                  ['cloudadmin', 'itsec', 'sysadmin', 'netadmin', 'developer'],
                  'Allowed roles for project')
# NOTE(vish): a user with one of these roles will be a superuser and
#             have access to all api commands
flags.DEFINE_list('superuser_roles', ['cloudadmin'],
                  'Roles that ignore authorization checking completely')

# NOTE(vish): a user with one of these roles will have it for every
#             project, even if he or she is not a member of the project
flags.DEFINE_list('global_roles', ['cloudadmin', 'itsec'],
                  'Roles that apply to all projects')

flags.DEFINE_string('credentials_template',
                    utils.abspath('auth/enginerc.template'),
                    'Template for creating users rc file')
flags.DEFINE_string('vpn_client_template',
                    utils.abspath('cloudpipe/client.ovpn.template'),
                    'Template for creating users vpn file')
flags.DEFINE_string('credential_vpn_file', 'engine-vpn.conf',
                    'Filename of certificate in credentials zip')
flags.DEFINE_string('credential_key_file', 'pk.pem',
                    'Filename of private key in credentials zip')
flags.DEFINE_string('credential_cert_file', 'cert.pem',
                    'Filename of certificate in credentials zip')
flags.DEFINE_string('credential_rc_file', '%src',
                    'Filename of rc in credentials zip, %s will be '
                    'replaced by name of the region (engine by default)')
flags.DEFINE_string('auth_driver', 'engine.auth.dbdriver.DbDriver',
                    'Driver that auth manager uses')
Beispiel #4
0
import tempfile

from engine import exception
from engine import flags
from engine import log as logging
from engine import utils
from engine.virt.disk import guestfs
from engine.virt.disk import loop
from engine.virt.disk import nbd

LOG = logging.getLogger('engine.compute.disk')
FLAGS = flags.FLAGS
flags.DEFINE_integer('minimum_root_size', 1024 * 1024 * 1024 * 10,
                     'minimum size in bytes of root partition')
flags.DEFINE_string('injected_network_template',
                    utils.abspath('virt/interfaces.template'),
                    'Template file for injected network')
flags.DEFINE_list('img_handlers', ['loop', 'nbd', 'guestfs'],
                  'Order of methods used to mount disk images')

# NOTE(yamahata): DEFINE_list() doesn't work because the command may
#                 include ','. For example,
#                 mkfs.ext3 -O dir_index,extent -E stride=8,stripe-width=16
#                 --label %(fs_label)s %(target)s
#
#                 DEFINE_list() parses its argument by
#                 [s.strip() for s in argument.split(self._token)]
#                 where self._token = ','
#                 No escape nor exceptional handling for ','.
#                 DEFINE_list() doesn't give us what we need.
flags.DEFINE_multistring(
Beispiel #5
0
import os
import signal

from Cheetah import Template

from engine import context
from engine import db
from engine import exception
from engine import flags
from engine import log as logging
from engine import utils


FLAGS = flags.FLAGS
flags.DEFINE_string('console_xvp_conf_template',
                    utils.abspath('console/xvp.conf.template'),
                    'XVP conf template')
flags.DEFINE_string('console_xvp_conf',
                    '/etc/xvp.conf',
                    'generated XVP conf file')
flags.DEFINE_string('console_xvp_pid',
                    '/var/run/xvp.pid',
                    'XVP master process pid file')
flags.DEFINE_string('console_xvp_log',
                    '/var/log/xvp.log',
                    'XVP log file')
flags.DEFINE_integer('console_xvp_multiplex_port',
                     5900,
                     'port for XVP to multiplex VNC connections on')

Beispiel #6
0
from engine import context
from engine import crypto
from engine import db
from engine import exception
from engine import flags
from engine import log as logging
from engine import utils
# TODO(eday): Eventually changes these to something not ec2-specific
from engine.api.ec2 import cloud
from engine.api.ec2 import ec2utils


FLAGS = flags.FLAGS
flags.DEFINE_string('boot_script_template',
                    utils.abspath('cloudpipe/bootscript.template'),
                    _('Template for script to run on cloudpipe instance boot'))
flags.DEFINE_string('dmz_net',
                    '10.0.0.0',
                    _('Network to push into openvpn config'))
flags.DEFINE_string('dmz_mask',
                    '255.255.255.0',
                    _('Netmask to push into openvpn config'))


LOG = logging.getLogger('engine.cloudpipe')


class CloudPipe(object):
    def __init__(self):
        self.controller = cloud.CloudController()