Fixed the lint errors

This commit is contained in:
viswesn 2016-11-11 15:52:16 +05:30
parent 5c21ca7609
commit 1a19e7918a
2 changed files with 14 additions and 15 deletions

View File

@ -1,7 +1,3 @@
import os
import socket
import subprocess
import charmhelpers.contrib.openstack.utils as ch_utils
import charmhelpers.core.hookenv as hookenv
import charms_openstack.charm
@ -9,8 +5,8 @@ import charms_openstack.ip as os_ip
RC_FILE = '/root/novarc'
class MuranoCharm(charms_openstack.charm.HAOpenStackCharm):
# Internal name of charm
service_name = name = 'murano'
@ -19,7 +15,7 @@ class MuranoCharm(charms_openstack.charm.HAOpenStackCharm):
# List of packages to install for this charm
packages = ['murano-api', 'murano-engine', 'python-pymysql', 'python-apt']
# Init services the charm manages
services = ['haproxy', 'murano-api', 'murano-engine']
@ -43,7 +39,8 @@ class MuranoCharm(charms_openstack.charm.HAOpenStackCharm):
ha_resources = ['vips', 'haproxy']
sync_cmd = ['murano-db-manage', '--config-file', '/etc/murano/murano.conf', 'upgrade']
sync_cmd = ['murano-db-manage', '--config-file',
'/etc/murano/murano.conf', 'upgrade']
def __init__(self, release=None, **kwargs):
"""Custom initialiser for class
@ -63,7 +60,7 @@ class MuranoCharm(charms_openstack.charm.HAOpenStackCharm):
def get_database_setup(self):
"""Provide the default database credentials as a list of 3-tuples
returns a structure of:
[
{'database': <database>,
@ -71,14 +68,12 @@ class MuranoCharm(charms_openstack.charm.HAOpenStackCharm):
'hostname': <hostname of this unit>
'prefix': <the optional prefix for the database>, },
]
:returns [{'database': ...}, ...]: credentials for multiple databases
"""
return [
dict(
database=self.config['database'],
username=self.config['database-user'],
hostname=hookenv.unit_private_ip(), )
dict(
database=self.config['database'],
username=self.config['database-user'],
hostname=hookenv.unit_private_ip(), )
]

View File

@ -15,7 +15,10 @@
import charms_openstack.charm as charm
import charms.reactive as reactive
# We need to import charm.openstack.murano to avoid
# No derived OpenStackCharm() classes registered
import charm.openstack.murano as murano
assert murano
charm.use_defaults(
'charm.installed',
@ -32,6 +35,7 @@ COMPLETE_INTERFACE_STATES = [
'amqp.available',
]
@reactive.when(*COMPLETE_INTERFACE_STATES)
def render_config(*args):
"""Render the configuration for charm when all the interfaces are