Improvments in Makefile and Amulets

This commit is contained in:
Bilal Baqar 2015-08-24 09:27:30 -07:00
parent f49a3c4afc
commit 7697abca82
6 changed files with 20 additions and 12 deletions

View File

@ -1,14 +1,18 @@
#!/usr/bin/make
PYTHON := /usr/bin/env python
lint:
@flake8 --exclude hooks/charmhelpers hooks
@flake8 --exclude hooks/charmhelpers unit_tests
virtualenv:
virtualenv .venv
.venv/bin/pip install flake8 nose coverage mock pyyaml netifaces \
netaddr jinja2
lint: virtualenv
.venv/bin/flake8 --exclude hooks/charmhelpers hooks unit_tests tests
@charm proof
unit_test:
unit_test: virtualenv
@echo Starting tests...
@$(PYTHON) /usr/bin/nosetests --nologcapture unit_tests
@.venv/bin/nosetests --nologcapture --with-coverage unit_tests
bin/charm_helpers_sync.py:
@mkdir -p bin

View File

@ -8,7 +8,7 @@ It is a subordinate charm to neutron-api charm.
# Usage
Step by step instructions on using the charm:
Instructions on using the charm:
juju deploy neutron-api
juju deploy neutron-api-plumgrid

View File

@ -1,6 +1,7 @@
# Copyright (c) 2015, PLUMgrid Inc, http://plumgrid.com
# This file contains the class that generates context for PLUMgrid template files.
# This file contains the class that generates context for
# PLUMgrid template files.
from charmhelpers.core.hookenv import (
config,
@ -96,7 +97,8 @@ class NeutronPGPluginContext(context.NeutronContext):
def pg_ctxt(self):
'''
Generated Config for all PLUMgrid templates inside the templates folder.
Generated Config for all PLUMgrid templates inside the
templates folder.
'''
pg_ctxt = super(NeutronPGPluginContext, self).pg_ctxt()
if not pg_ctxt:
@ -110,7 +112,8 @@ class NeutronPGPluginContext(context.NeutronContext):
pg_ctxt['metadata_mode'] = 'tunnel'
if enable_metadata:
plumgrid_edge_settings = _edge_settings()
pg_ctxt['nova_metadata_proxy_secret'] = plumgrid_edge_settings['metadata_shared_secret']
pg_ctxt['nova_metadata_proxy_secret'] = \
plumgrid_edge_settings['metadata_shared_secret']
else:
pg_ctxt['nova_metadata_proxy_secret'] = 'plumgrid'

View File

@ -2,4 +2,4 @@
sudo add-apt-repository ppa:juju/stable -y
sudo apt-get update
sudo apt-get install amulet python-requests -y
sudo apt-get install amulet -y

View File

@ -9,7 +9,7 @@ class TestDeployment(unittest.TestCase):
def setUpClass(cls):
cls.deployment = amulet.Deployment(series='trusty')
cls.deployment.load_bundle_file(
bundle_file='files/neutron-api-plumgrid.yaml',
bundle_file='tests/files/neutron-api-plumgrid.yaml',
deployment_name='test')
try:
cls.deployment.setup(timeout=2000)

View File

@ -43,7 +43,8 @@ class NeutronPGContextTest(CharmTestCase):
@patch.object(charmhelpers.contrib.openstack.context, 'unit_private_ip')
def test_neutroncc_context_api_rel(self, _unit_priv_ip, _npa, _ens_pkgs,
_save_ff, _https, _is_clus, _unit_get,
_config, _runits, _rids, _rget, _con_settings):
_config, _runits, _rids, _rget,
_con_settings):
def mock_npa(plugin, section, manager):
if section == "driver":
return "neutron.randomdriver"