Tidy lint

This commit is contained in:
James Page 2014-11-07 17:46:25 +01:00
parent fac65a99f2
commit 6665c3b78f
7 changed files with 36 additions and 75 deletions

View File

@ -2,7 +2,7 @@
PYTHON := /usr/bin/env python
lint:
@flake8 --exclude hooks/charmhelpers hooks unit_tests
@flake8 --exclude hooks/charmhelpers hooks
@charm proof
sync:

View File

@ -5,18 +5,23 @@ options:
description: OpenStack release to use for configuration of POWER hypervisor.
power-user:
type: string
default:
description: Username used to access POWER hypervisors.
power-key:
type: string
default:
description: SSH key to use to accesss POWER hypervisors.
power-repo:
type: string
default:
description: RPM repository of OpenStack packages to deploy to POWER hypervisors.
power-hosts:
type: string
default:
description: POWER hosts to manager; space delimited.
power-password:
type: string
default:
description: sudo password on POWER hypervisor
rabbit-user:
default: nova
@ -25,7 +30,7 @@ options:
rabbit-vhost:
default: openstack
type: string
decsription: Rabbitmq vhost
description: Rabbitmq vhost
use-syslog:
type: boolean
default: False
@ -40,56 +45,11 @@ options:
default: nova
type: string
description: Database name
multi-host:
default: "yes"
type: string
description: Whether to run nova-api and nova-network on the compute nodes.
enable-resize:
default: False
type: boolean
description: Enable instance resizing, which requires that passwordless SSH
access be setup between compute hosts.
enable-live-migration:
default: False
type: boolean
description: Configure libvirt for live migration.
migration-auth-type:
default: sasl
type: string
description: |
TCP authentication scheme for libvirt live migration. Available options
include sasl or none.
# needed if using flatmanager
bridge-interface:
default: br100
type: string
description: Bridge interface to be configured
bridge-ip:
default: 11.0.0.1
type: string
description: IP to be assigned to bridge interface
bridge-netmask:
default: 255.255.255.0
type: string
description: Netmask to be assigned to bridge interface
# needed if using flatdhcpmanager
flat-interface:
default: eth1
type: string
description: Network interface on which to build bridge
instances-path:
type: string
default:
description: Instance path to use - empty means default of /var/lib/nova/instances
config-flags:
type: string
default:
description: Comma separated list of key=value config flags to be set in nova.conf.
nagios_context:
default: "juju"
type: string
description: |
Used by the nrpe-external-master subordinate charm.
A string that will be prepended to instance name to set the host name
in nagios. So for instance the hostname would be something like:
juju-myservice-0
If you're running multiple environments with the same services in them
this allows you to differentiate between them.

2
hooks/fabfile.py vendored
View File

@ -30,7 +30,7 @@ def yum_install(packages):
def restart_service(service):
sudo('service openstack-nova-%s restart' %service)
sudo('service openstack-nova-%s restart' % service)
def add_bridge():

View File

@ -44,32 +44,32 @@ def _network_manager():
def _neutron_security_groups():
'''
Inspects current cloud-compute relation and determine if nova-c-c has
instructed us to use neutron security groups.
'''
for rid in relation_ids('cloud-compute'):
for unit in related_units(rid):
groups = [
relation_get('neutron_security_groups',
rid=rid, unit=unit),
relation_get('quantum_security_groups',
rid=rid, unit=unit)
]
if ('yes' in groups or 'Yes' in groups):
return True
return False
'''
Inspects current cloud-compute relation and determine if nova-c-c has
instructed us to use neutron security groups.
'''
for rid in relation_ids('cloud-compute'):
for unit in related_units(rid):
groups = [
relation_get('neutron_security_groups',
rid=rid, unit=unit),
relation_get('quantum_security_groups',
rid=rid, unit=unit)
]
if ('yes' in groups or 'Yes' in groups):
return True
return False
def _neutron_plugin():
from nova_compute_utils import neutron_plugin
return neutron_plugin()
from nova_compute_utils import neutron_plugin
return neutron_plugin()
def _neutron_url(rid, unit):
# supports legacy relation settings.
return (relation_get('neutron_url', rid=rid, unit=unit) or
relation_get('quantum_url', rid=rid, unit=unit))
# supports legacy relation settings.
return (relation_get('neutron_url', rid=rid, unit=unit) or
relation_get('quantum_url', rid=rid, unit=unit))
class NovaComputeLibvirtContext(context.OSContextGenerator):

View File

@ -79,7 +79,7 @@ class POWERProxy():
env.connection_attempts = 10
env.timeout = 10
env.user = self.user
env.key_filename= self.key_filename
env.key_filename = self.key_filename
env.hosts = self.hosts
env.password = self.password
@ -150,7 +150,7 @@ def restart_on_change(restart_map, func):
if checksums[path] != file_hash(path):
restarts += restart_map[path]
services_list = list(OrderedDict.fromkeys(restarts))
for service_name in services_list:
func(service_name)
for s_name in services_list:
func(s_name)
return wrapped_f
return wrap

View File

@ -99,7 +99,8 @@ def resource_map():
resource_map.update(nm_rsc)
conf = os.path.join(conf_path,
neutron_plugin_attribute(plugin, 'config', net_manager))
neutron_plugin_attribute(plugin, 'config',
net_manager))
ctxts = (neutron_plugin_attribute(plugin, 'contexts', net_manager)
or [])
resource_map[conf] = {}

View File

@ -5,7 +5,7 @@ description: |
OpenStack Compute, codenamed Nova, is a cloud computing fabric controller. In
addition to its "native" API (the OpenStack API), it also supports the Amazon
EC2 API.
categories:
tags:
- openstack
provides:
cloud-compute: