aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingli Yu <Mingli.Yu@windriver.com>2018-10-11 11:50:17 +0800
committerBruce Ashfield <bruce.ashfield@windriver.com>2018-10-11 14:46:29 -0400
commit5b4e2a5ff9b36b6b244bfa0861bc8f8da16a832f (patch)
tree076a8876d939ad086670fe8f0e5c71e8216ec3c5
parent64d636847a62f76ca8383e83fa4719180e80bacb (diff)
downloadmeta-cloud-services-5b4e2a5ff9b36b6b244bfa0861bc8f8da16a832f.tar.gz
meta-cloud-services-5b4e2a5ff9b36b6b244bfa0861bc8f8da16a832f.tar.bz2
meta-cloud-services-5b4e2a5ff9b36b6b244bfa0861bc8f8da16a832f.zip
sanity-meta-openstack.bbclass: add class for bbappend files checking
Add a new class sanity-meta-openstack.bbclass, to check whether necessary settings are available for bbappend files and preferred version setting in this layer to be effective and warn users if not. In addition, a variable SKIP_SANITY_META_OPENSTACK_CHECK is added to enable users to explicitly skip the checking to avoid unwanted warnings. Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--meta-openstack/README19
-rw-r--r--meta-openstack/classes/sanity-meta-openstack.bbclass10
-rw-r--r--meta-openstack/conf/layer.conf4
3 files changed, 33 insertions, 0 deletions
diff --git a/meta-openstack/README b/meta-openstack/README
index 81b843b..8506250 100644
--- a/meta-openstack/README
+++ b/meta-openstack/README
@@ -5,6 +5,25 @@ This layer provides support for building the packages from the OpenStack project
The layer contains recipes for the nova, glance, keystone, cinder, quantum, swift
and horizon components.
+The bbappend files for some recipes (e.g. postgresql) and preferred version setting
+(e.g. python-networkx)in this layer need to have 'openstack' in DISTRO_FEATURES to
+have effect. To enable them, add in configuration file the following line.
+
+ DISTRO_FEATURES_append = " openstack"
+
+If meta-openstack is included, but openstack is not enabled as a
+distro feature a warning is printed at parse time:
+
+ You have included the meta-openstack layer, but
+ 'openstack' has not been enabled in your DISTRO_FEATURES. Some bbappend files
+ and preferred version setting may not take effect. See the meta-openstack README
+ for details on enabling openstack support.
+
+If you know what you are doing, this warning can be disabled by setting the following
+variable in your configuration:
+
+ SKIP_META_OPENSTACK_SANITY_CHECK = 1
+
Dependencies
------------
diff --git a/meta-openstack/classes/sanity-meta-openstack.bbclass b/meta-openstack/classes/sanity-meta-openstack.bbclass
new file mode 100644
index 0000000..3d5e57b
--- /dev/null
+++ b/meta-openstack/classes/sanity-meta-openstack.bbclass
@@ -0,0 +1,10 @@
+addhandler openstack_bbappend_distrocheck
+openstack_bbappend_distrocheck[eventmask] = "bb.event.SanityCheck"
+python openstack_bbappend_distrocheck() {
+ skip_check = e.data.getVar('SKIP_META_OPENSTACK_SANITY_CHECK') == "1"
+ if 'openstack' not in e.data.getVar('DISTRO_FEATURES').split() and not skip_check:
+ bb.warn("You have included the meta-openstack layer, but \
+'openstack' has not been enabled in your DISTRO_FEATURES. Some bbappend files \
+and preferred version setting may not take effect. See the meta-openstack README \
+for details on enabling openstack support.")
+}
diff --git a/meta-openstack/conf/layer.conf b/meta-openstack/conf/layer.conf
index 4ce6ea7..9ca806e 100644
--- a/meta-openstack/conf/layer.conf
+++ b/meta-openstack/conf/layer.conf
@@ -35,4 +35,8 @@ PREFERRED_VERSION_python-jsonschema = "2.6.0"
PREFERRED_VERSION_python-networkx = "1.11"
PREFERRED_VERSION_python-oslo.i18n = "3.17.0+gitAUTOINC+f2729cd36f"
+# Sanity check for meta-openstack layer.
+# Setting SKIP_META_OPENSTACK_SANITY_CHECK to "1" would skip the bbappend files check.
+INHERIT += "sanity-meta-openstack"
+
LICENSE_PATH += "${LAYERDIR}/licenses"