From 773b360a7025d6e5440d3de254b4329b95a84f4a Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 19 Feb 2018 10:09:35 +0000 Subject: [PATCH] Restructure charm to follow src dir format The OpenStack reactive charms use a src directory to store the 'source' charm. Convert the vault charm to comply with this structure. Change-Id: I7dd36b9aa7419459238f989dfe6c0553f7641cdf --- README.md => src/README.md | 0 config.yaml => src/config.yaml | 0 src/copyright | 16 ++++++++++++++++ .../files}/nagios/check_vault_version.py | 0 layer.yaml => src/layer.yaml | 0 metadata.yaml => src/metadata.yaml | 0 {reactive => src/reactive}/vault.py | 0 {templates => src/templates}/vault.hcl.j2 | 0 {templates => src/templates}/vault.service.j2 | 0 tox.ini | 13 ++++++++----- unit_tests/__init__.py | 5 +++++ 11 files changed, 29 insertions(+), 5 deletions(-) rename README.md => src/README.md (100%) rename config.yaml => src/config.yaml (100%) create mode 100644 src/copyright rename {files => src/files}/nagios/check_vault_version.py (100%) rename layer.yaml => src/layer.yaml (100%) rename metadata.yaml => src/metadata.yaml (100%) rename {reactive => src/reactive}/vault.py (100%) rename {templates => src/templates}/vault.hcl.j2 (100%) rename {templates => src/templates}/vault.service.j2 (100%) diff --git a/README.md b/src/README.md similarity index 100% rename from README.md rename to src/README.md diff --git a/config.yaml b/src/config.yaml similarity index 100% rename from config.yaml rename to src/config.yaml diff --git a/src/copyright b/src/copyright new file mode 100644 index 0000000..a6441e1 --- /dev/null +++ b/src/copyright @@ -0,0 +1,16 @@ +Format: http://dep.debian.net/deps/dep5/ + +Files: * +Copyright: Copyright 2017, Canonical Ltd. +License: GPL-3 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License version 3, as + published by the Free Software Foundation. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranties of + MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . diff --git a/files/nagios/check_vault_version.py b/src/files/nagios/check_vault_version.py similarity index 100% rename from files/nagios/check_vault_version.py rename to src/files/nagios/check_vault_version.py diff --git a/layer.yaml b/src/layer.yaml similarity index 100% rename from layer.yaml rename to src/layer.yaml diff --git a/metadata.yaml b/src/metadata.yaml similarity index 100% rename from metadata.yaml rename to src/metadata.yaml diff --git a/reactive/vault.py b/src/reactive/vault.py similarity index 100% rename from reactive/vault.py rename to src/reactive/vault.py diff --git a/templates/vault.hcl.j2 b/src/templates/vault.hcl.j2 similarity index 100% rename from templates/vault.hcl.j2 rename to src/templates/vault.hcl.j2 diff --git a/templates/vault.service.j2 b/src/templates/vault.service.j2 similarity index 100% rename from templates/vault.service.j2 rename to src/templates/vault.service.j2 diff --git a/tox.ini b/tox.ini index 9035421..d7541f0 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ # within individual charm repos. [tox] skipsdist = True -envlist = pep8,py34,py35 +envlist = pep8,py34,py35,py36 skip_missing_interpreters = True [testenv] @@ -21,9 +21,8 @@ deps = [testenv:build] basepython = python2.7 -# Update when charm moves to src subdir commands = - charm-build --log-level DEBUG -o {toxinidir}/build . {posargs} + charm-build --log-level DEBUG -o {toxinidir}/build src {posargs} [testenv:py27] basepython = python2.7 @@ -43,11 +42,15 @@ basepython = python3.5 deps = -r{toxinidir}/test-requirements.txt commands = ostestr {posargs} +[testenv:py36] +basepython = python3.6 +deps = -r{toxinidir}/test-requirements.txt +commands = ostestr {posargs} + [testenv:pep8] basepython = python3.5 deps = -r{toxinidir}/test-requirements.txt -# Update when charm moves to src subdir -commands = flake8 --exclude build {posargs} . +commands = flake8 {posargs} src unit_tests [testenv:venv] commands = {posargs} diff --git a/unit_tests/__init__.py b/unit_tests/__init__.py index 35411ac..367d6ee 100644 --- a/unit_tests/__init__.py +++ b/unit_tests/__init__.py @@ -1 +1,6 @@ # unit tests + +import sys + +sys.path.append('src') +sys.path.append('src/lib')