From 85a4f525cef66735f2fae72cc31a35fd3f831815 Mon Sep 17 00:00:00 2001 From: James Page Date: Mon, 20 Apr 2020 11:34:21 +0100 Subject: [PATCH] misc: add gerrit integration Add zuul configuration. Add gitreview configuration. Add custom status check to ensure charm units remain in a blocked state until the nfs-shares configuration option is set. Change-Id: I01257c143109865adf3c88e687da3c8d440eff81 --- .gitreview | 4 ++++ .zuul.yaml | 5 +++++ requirements.txt | 11 ++--------- src/lib/charm/openstack/trilio_dm.py | 6 ++++++ src/test-requirements.txt | 2 +- test-requirements.txt | 20 ++------------------ 6 files changed, 20 insertions(+), 28 deletions(-) create mode 100644 .gitreview create mode 100644 .zuul.yaml diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..7a435aa --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.opendev.org +port=29418 +project=openstack/charm-trilio-data-mover.git diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..b3037e9 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,5 @@ +- project: + templates: + - python35-charm-jobs + - openstack-python3-ussuri-jobs + - openstack-cover-jobs diff --git a/requirements.txt b/requirements.txt index 5f2fff3..6371beb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,3 @@ -# This file is managed centrally by release-tools and should not be modified -# within individual charm repos. See the 'global' dir contents for available -# choices of *requirements.txt files for OpenStack Charms: -# https://github.com/openstack-charmers/release-tools -# -# Build requirements -charm-tools>=2.4.4 -# importlib-resources 1.1.0 removed Python 3.5 support -importlib-resources<1.1.0 +# Requirements to build the charm +charm-tools simplejson diff --git a/src/lib/charm/openstack/trilio_dm.py b/src/lib/charm/openstack/trilio_dm.py index a6c01ec..4510845 100644 --- a/src/lib/charm/openstack/trilio_dm.py +++ b/src/lib/charm/openstack/trilio_dm.py @@ -134,3 +134,9 @@ class TrilioDataMoverCharm(charms_openstack.charm.OpenStackCharm): os.mkdir(ghost_share_path) host.mount(nfs_share_path, ghost_share_path, options="bind") + + def custom_assess_status_check(self): + """Check required configuration options are set""" + if not hookenv.config("nfs-shares"): + return "blocked", "nfs-shares configuration not set" + return None, None diff --git a/src/test-requirements.txt b/src/test-requirements.txt index d3c9be8..b4edb8f 100644 --- a/src/test-requirements.txt +++ b/src/test-requirements.txt @@ -5,4 +5,4 @@ # # Functional Test Requirements (let Zaza's dependencies solve all dependencies here!) git+https://github.com/openstack-charmers/zaza.git#egg=zaza -git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack +git+https://github.com/javacruft/zaza-openstack-tests.git@triliovault-testing#egg=zaza.openstack diff --git a/test-requirements.txt b/test-requirements.txt index 1c8aff7..4d70242 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,23 +1,7 @@ -# This file is managed centrally by release-tools and should not be modified -# within individual charm repos. See the 'global' dir contents for available -# choices of *requirements.txt files for OpenStack Charms: -# https://github.com/openstack-charmers/release-tools -# -# Lint and unit test requirements +# Unit test requirements flake8>=2.2.4 stestr>=2.2.0 -requests>=2.18.4 charms.reactive mock>=1.2 -nose>=1.3.7 coverage>=3.6 -git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack -# -# Revisit for removal / mock improvement: -netifaces # vault -psycopg2-binary # vault -tenacity # vault -pbr # vault -cryptography # vault, keystone-saml-mellon -lxml # keystone-saml-mellon -hvac # vault, barbican-vault +git+https://github.com/openstack/charms.openstack#egg=charms.openstack