pylint cleanups
This commit is contained in:
parent
245f36bc64
commit
a7acb03e4e
@ -94,7 +94,7 @@ class PkgInstallComponent(component.Component):
|
|||||||
uri = self.get_option(key, '').strip()
|
uri = self.get_option(key, '').strip()
|
||||||
if not uri:
|
if not uri:
|
||||||
raise ValueError(("Could not find uri in config to download "
|
raise ValueError(("Could not find uri in config to download "
|
||||||
"from at section %s for option %s") % (section, key))
|
"from option %s") % (key))
|
||||||
return (uri, self.get_option('app_dir'))
|
return (uri, self.get_option('app_dir'))
|
||||||
|
|
||||||
def download(self):
|
def download(self):
|
||||||
@ -493,7 +493,7 @@ class PythonRuntime(ProgramRuntime):
|
|||||||
starter_cls = importer.import_entry_point(run_type)
|
starter_cls = importer.import_entry_point(run_type)
|
||||||
starter = starter_cls(self)
|
starter = starter_cls(self)
|
||||||
for i, app_info in enumerate(self.apps_to_start):
|
for i, app_info in enumerate(self.apps_to_start):
|
||||||
self._start_app(app_info, start)
|
self._start_app(app_info, run_type, starter)
|
||||||
am_started = i + 1
|
am_started = i + 1
|
||||||
self._post_app_start(app_info)
|
self._post_app_start(app_info)
|
||||||
return am_started
|
return am_started
|
||||||
@ -511,7 +511,8 @@ class PythonRuntime(ProgramRuntime):
|
|||||||
|
|
||||||
def _post_app_start(self, app_info):
|
def _post_app_start(self, app_info):
|
||||||
if 'sleep_time' in app_info:
|
if 'sleep_time' in app_info:
|
||||||
LOG.info("%s requested a %s second sleep time, please wait...", colorizer.quote(app_name), app_info.get('sleep_time'))
|
LOG.info("%s requested a %s second sleep time, please wait...",
|
||||||
|
colorizer.quote(app_info.get('name')), app_info.get('sleep_time'))
|
||||||
sh.sleep(float(app_info.get('sleep_time')))
|
sh.sleep(float(app_info.get('sleep_time')))
|
||||||
|
|
||||||
def _locate_investigators(self, apps_started):
|
def _locate_investigators(self, apps_started):
|
||||||
@ -523,7 +524,7 @@ class PythonRuntime(ProgramRuntime):
|
|||||||
inv_cls = importer.import_entry_point(run_type)
|
inv_cls = importer.import_entry_point(run_type)
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
LOG.warn("Could not load class %s which should be used to investigate %s: %s",
|
LOG.warn("Could not load class %s which should be used to investigate %s: %s",
|
||||||
colorizer.quote(how), colorizer.quote(app_name), e)
|
colorizer.quote(run_type), colorizer.quote(app_name), e)
|
||||||
continue
|
continue
|
||||||
investigator = None
|
investigator = None
|
||||||
if inv_cls in investigator_created:
|
if inv_cls in investigator_created:
|
||||||
|
@ -20,6 +20,7 @@ from anvil import cfg
|
|||||||
from anvil import components as comp
|
from anvil import components as comp
|
||||||
from anvil import log as logging
|
from anvil import log as logging
|
||||||
from anvil import shell as sh
|
from anvil import shell as sh
|
||||||
|
from anvil import utils
|
||||||
|
|
||||||
from anvil.components.helpers import db as dbhelper
|
from anvil.components.helpers import db as dbhelper
|
||||||
from anvil.components.helpers import glance as ghelper
|
from anvil.components.helpers import glance as ghelper
|
||||||
@ -40,7 +41,6 @@ CONFIGS = [API_CONF, REG_CONF, API_PASTE_CONF,
|
|||||||
# Reg, api, scrub are here as possible subsystems
|
# Reg, api, scrub are here as possible subsystems
|
||||||
GAPI = "api"
|
GAPI = "api"
|
||||||
GREG = "reg"
|
GREG = "reg"
|
||||||
GSCR = 'scrub'
|
|
||||||
|
|
||||||
# This db will be dropped and created
|
# This db will be dropped and created
|
||||||
DB_NAME = "glance"
|
DB_NAME = "glance"
|
||||||
@ -49,14 +49,12 @@ DB_NAME = "glance"
|
|||||||
APP_OPTIONS = {
|
APP_OPTIONS = {
|
||||||
'glance-api': ['--config-file', sh.joinpths('%CONFIG_DIR%', API_CONF)],
|
'glance-api': ['--config-file', sh.joinpths('%CONFIG_DIR%', API_CONF)],
|
||||||
'glance-registry': ['--config-file', sh.joinpths('%CONFIG_DIR%', REG_CONF)],
|
'glance-registry': ['--config-file', sh.joinpths('%CONFIG_DIR%', REG_CONF)],
|
||||||
'glance-scrubber': ['--config-file', sh.joinpths('%CONFIG_DIR%', REG_CONF)],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# How the subcompoent small name translates to an actual app
|
# How the subcompoent small name translates to an actual app
|
||||||
SUB_TO_APP = {
|
SUB_TO_APP = {
|
||||||
GAPI: 'glance-api',
|
GAPI: 'glance-api',
|
||||||
GREG: 'glance-registry',
|
GREG: 'glance-registry',
|
||||||
GSCR: 'glance-scrubber',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -106,9 +104,10 @@ class GlanceInstaller(GlanceMixin, comp.PythonInstallComponent):
|
|||||||
dbhelper.get_shared_passwords(self)))
|
dbhelper.get_shared_passwords(self)))
|
||||||
|
|
||||||
def source_config(self, config_fn):
|
def source_config(self, config_fn):
|
||||||
real_fn = config_fn
|
|
||||||
if config_fn == LOGGING_CONF:
|
if config_fn == LOGGING_CONF:
|
||||||
real_fn = 'logging.cnf.sample'
|
real_fn = 'logging.cnf.sample'
|
||||||
|
else:
|
||||||
|
real_fn = config_fn
|
||||||
fn = sh.joinpths(self.get_option('app_dir'), 'etc', real_fn)
|
fn = sh.joinpths(self.get_option('app_dir'), 'etc', real_fn)
|
||||||
return (fn, sh.load_file(fn))
|
return (fn, sh.load_file(fn))
|
||||||
|
|
||||||
@ -117,8 +116,8 @@ class GlanceInstaller(GlanceMixin, comp.PythonInstallComponent):
|
|||||||
with io.BytesIO(contents) as stream:
|
with io.BytesIO(contents) as stream:
|
||||||
config = cfg.RewritableConfigParser()
|
config = cfg.RewritableConfigParser()
|
||||||
config.readfp(stream)
|
config.readfp(stream)
|
||||||
config.set('DEFAULT', 'debug', True)
|
config.set('DEFAULT', 'debug', self.get_option('verbose', False))
|
||||||
config.set('DEFAULT', 'verbose', True)
|
config.set('DEFAULT', 'verbose', self.get_option('verbose', False))
|
||||||
config.set('DEFAULT', 'bind_port', params['endpoints']['registry']['port'])
|
config.set('DEFAULT', 'bind_port', params['endpoints']['registry']['port'])
|
||||||
config.set('DEFAULT', 'sql_connection', dbhelper.fetch_dbdsn(dbname=DB_NAME,
|
config.set('DEFAULT', 'sql_connection', dbhelper.fetch_dbdsn(dbname=DB_NAME,
|
||||||
utf8=True,
|
utf8=True,
|
||||||
@ -158,8 +157,8 @@ class GlanceInstaller(GlanceMixin, comp.PythonInstallComponent):
|
|||||||
config = cfg.RewritableConfigParser()
|
config = cfg.RewritableConfigParser()
|
||||||
config.readfp(stream)
|
config.readfp(stream)
|
||||||
img_store_dir = sh.joinpths(self.get_option('component_dir'), 'images')
|
img_store_dir = sh.joinpths(self.get_option('component_dir'), 'images')
|
||||||
config.set('DEFAULT', 'debug', True)
|
config.set('DEFAULT', 'debug', self.get_option('verbose', False))
|
||||||
config.set('DEFAULT', 'verbose', True)
|
config.set('DEFAULT', 'verbose', self.get_option('verbose', False))
|
||||||
config.set('DEFAULT', 'default_store', 'file')
|
config.set('DEFAULT', 'default_store', 'file')
|
||||||
config.set('DEFAULT', 'filesystem_store_datadir', img_store_dir)
|
config.set('DEFAULT', 'filesystem_store_datadir', img_store_dir)
|
||||||
config.set('DEFAULT', 'bind_port', params['endpoints']['public']['port'])
|
config.set('DEFAULT', 'bind_port', params['endpoints']['public']['port'])
|
||||||
|
@ -26,6 +26,8 @@ from anvil import shell as sh
|
|||||||
from anvil import utils
|
from anvil import utils
|
||||||
|
|
||||||
from anvil.components.helpers import db as dbhelper
|
from anvil.components.helpers import db as dbhelper
|
||||||
|
from anvil.components.helpers import rabbit as rbhelper
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -228,9 +230,9 @@ class ConfConfigurator(object):
|
|||||||
# How is your message queue setup?
|
# How is your message queue setup?
|
||||||
mq_type = canon_mq_type(self._getstr('mq'))
|
mq_type = canon_mq_type(self._getstr('mq'))
|
||||||
if mq_type == 'rabbit':
|
if mq_type == 'rabbit':
|
||||||
nova_conf.add('rabbit_host', self.cfg.getdefaulted('rabbit', 'rabbit_host', hostip))
|
nova_conf.add('rabbit_host', self._getstr('rabbit.host', hostip))
|
||||||
nova_conf.add('rabbit_password', self.cfg.get("passwords", "rabbit"))
|
nova_conf.add('rabbit_password', rbhelper.get_shared_passwords(self.installer)['pw'])
|
||||||
nova_conf.add('rabbit_userid', self.cfg.get('rabbit', 'rabbit_userid'))
|
nova_conf.add('rabbit_userid', self._getstr('rabbit.user_id'))
|
||||||
nova_conf.add('rpc_backend', 'nova.rpc.impl_kombu')
|
nova_conf.add('rpc_backend', 'nova.rpc.impl_kombu')
|
||||||
|
|
||||||
# Where instances will be stored
|
# Where instances will be stored
|
||||||
|
@ -26,7 +26,7 @@ from anvil import colorizer
|
|||||||
from anvil import log as logging
|
from anvil import log as logging
|
||||||
from anvil import shell as sh
|
from anvil import shell as sh
|
||||||
from anvil import utils
|
from anvil import utils
|
||||||
|
|
||||||
from anvil.components import db
|
from anvil.components import db
|
||||||
from anvil.components import horizon
|
from anvil.components import horizon
|
||||||
from anvil.components import nova
|
from anvil.components import nova
|
||||||
@ -147,7 +147,7 @@ class NovaInstaller(nova.NovaInstaller):
|
|||||||
|
|
||||||
def configure(self):
|
def configure(self):
|
||||||
configs_made = nova.NovaInstaller.configure(self)
|
configs_made = nova.NovaInstaller.configure(self)
|
||||||
driver_canon = nhelper.canon_virt_driver(self.cfg.get('nova', 'virt_driver'))
|
driver_canon = nhelper.canon_virt_driver(self.get_option('virt_driver'))
|
||||||
if driver_canon == 'libvirt':
|
if driver_canon == 'libvirt':
|
||||||
# Create a libvirtd user group
|
# Create a libvirtd user group
|
||||||
if not sh.group_exists('libvirtd'):
|
if not sh.group_exists('libvirtd'):
|
||||||
|
@ -2,20 +2,25 @@
|
|||||||
---
|
---
|
||||||
# Where we download this from...
|
# Where we download this from...
|
||||||
get_from: "git://github.com/openstack/glance.git?branch=master"
|
get_from: "git://github.com/openstack/glance.git?branch=master"
|
||||||
|
|
||||||
host: "$(auto:ip)"
|
host: "$(auto:ip)"
|
||||||
api_port: 9292
|
api_port: 9292
|
||||||
reg_port: 9191
|
reg_port: 9191
|
||||||
protocol: http
|
protocol: http
|
||||||
|
verbose: True
|
||||||
|
|
||||||
# List of images to download and install into glance.
|
# List of images to download and install into glance.
|
||||||
image_urls:
|
image_urls:
|
||||||
- http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
|
- http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
|
||||||
- http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz
|
- http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-11.2_2.6.35-15_1.tar.gz
|
||||||
|
|
||||||
# Needed for setting up your database
|
# Needed for setting up your database
|
||||||
db:
|
db:
|
||||||
type: "$(db:type)"
|
type: "$(db:type)"
|
||||||
user: "$(db:user)"
|
user: "$(db:user)"
|
||||||
host: "$(db:host)"
|
host: "$(db:host)"
|
||||||
port: "$(db:port)"
|
port: "$(db:port)"
|
||||||
|
|
||||||
# Interactions with keystone are via the following settings
|
# Interactions with keystone are via the following settings
|
||||||
paste_flavor: 'keystone'
|
paste_flavor: 'keystone'
|
||||||
keystone:
|
keystone:
|
||||||
|
@ -136,4 +136,9 @@ keystone:
|
|||||||
service_port: "$(keystone:service_port)"
|
service_port: "$(keystone:service_port)"
|
||||||
service_proto: "$(keystone:service_proto)"
|
service_proto: "$(keystone:service_proto)"
|
||||||
|
|
||||||
|
# Rabbit mq hookins
|
||||||
|
rabbit:
|
||||||
|
user_id: "$(rabbit-mq:user_id)"
|
||||||
|
host: "$(rabbit-mq:host)"
|
||||||
|
|
||||||
...
|
...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user