All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking
@ 2018-10-11  3:50 mingli.yu
  2018-10-11  3:50 ` [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx mingli.yu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: mingli.yu @ 2018-10-11  3:50 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

From: Mingli Yu <Mingli.Yu@windriver.com>

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>
---
 meta-openstack/README                                | 19 +++++++++++++++++++
 meta-openstack/classes/sanity-meta-openstack.bbclass | 10 ++++++++++
 meta-openstack/conf/layer.conf                       |  4 ++++
 3 files changed, 33 insertions(+)
 create mode 100644 meta-openstack/classes/sanity-meta-openstack.bbclass

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 126f37f..f322bcd 100644
--- a/meta-openstack/conf/layer.conf
+++ b/meta-openstack/conf/layer.conf
@@ -35,5 +35,9 @@ 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"
 LAYERRECOMMENDS_openstack-layer = "meta-openstack-dl (= 2.6)"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx
  2018-10-11  3:50 [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking mingli.yu
@ 2018-10-11  3:50 ` mingli.yu
  2018-10-11 18:47   ` Bruce Ashfield
  2018-10-11  3:50 ` [meta-openstack][PATCH 3/3] postgresql: make append version independent mingli.yu
  2018-10-11 18:47 ` [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking Bruce Ashfield
  2 siblings, 1 reply; 7+ messages in thread
From: mingli.yu @ 2018-10-11  3:50 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

From: Mingli Yu <Mingli.Yu@windriver.com>

Only set PREFERRED_VERSION for python-networkx
when the openstack distro is enabled

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
 meta-openstack/conf/layer.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-openstack/conf/layer.conf b/meta-openstack/conf/layer.conf
index f322bcd..598e157 100644
--- a/meta-openstack/conf/layer.conf
+++ b/meta-openstack/conf/layer.conf
@@ -32,7 +32,7 @@ PREFERRED_VERSION_python-sqlalchemy = "1.0.16"
 PREFERRED_VERSION_python-eventlet = "0.20.0"
 PREFERRED_VERSION_python-warlock = "1.2.0"
 PREFERRED_VERSION_python-jsonschema = "2.6.0"
-PREFERRED_VERSION_python-networkx = "1.11"
+PREFERRED_VERSION_python-networkx = "${@bb.utils.contains('DISTRO_FEATURES', 'openstack', '1.11', '', d)}"
 PREFERRED_VERSION_python-oslo.i18n = "3.17.0+gitAUTOINC+f2729cd36f"
 
 # Sanity check for meta-openstack layer.
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [meta-openstack][PATCH 3/3] postgresql: make append version independent
  2018-10-11  3:50 [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking mingli.yu
  2018-10-11  3:50 ` [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx mingli.yu
@ 2018-10-11  3:50 ` mingli.yu
  2018-10-11 18:47   ` Bruce Ashfield
  2018-10-11 18:47 ` [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking Bruce Ashfield
  2 siblings, 1 reply; 7+ messages in thread
From: mingli.yu @ 2018-10-11  3:50 UTC (permalink / raw)
  To: bruce.ashfield, meta-virtualization

From: Mingli Yu <Mingli.Yu@windriver.com>

Make bbappend version independent and only
effective when the openstack distro enabled.

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
 .../recipes-dbs/postgresql/postgresql_%.bbappend   |  1 +
 .../recipes-dbs/postgresql/postgresql_9.%.bbappend | 60 ----------------------
 .../postgresql/postgresql_openstack.inc            | 60 ++++++++++++++++++++++
 3 files changed, 61 insertions(+), 60 deletions(-)
 create mode 100644 meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend
 delete mode 100644 meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend
 create mode 100644 meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc

diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend b/meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend
new file mode 100644
index 0000000..025ee4e
--- /dev/null
+++ b/meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('DISTRO_FEATURES', 'openstack', '${BPN}_openstack.inc', '', d)}
diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend b/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend
deleted file mode 100644
index 5bf25e1..0000000
--- a/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend
+++ /dev/null
@@ -1,60 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += " \
-    file://postgresql-init \
-    file://postgresql-init.service \
-    "
-
-inherit identity hosts
-
-SYSTEMD_AUTO_ENABLE_${PN} = "enable"
-
-# default
-DB_DATADIR ?= "/var/lib/postgres/data"
-
-do_install_append() {
-    D_DEST_DIR=${D}${sysconfdir}/postgresql
-
-    install -d ${D_DEST_DIR}
-    install -m 0755 ${WORKDIR}/postgresql-init ${D_DEST_DIR}/postgresql-init
-
-    sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${D_DEST_DIR}/postgresql-init
-
-    sed -e "s:%DB_USER%:${DB_USER}:g" -i ${D_DEST_DIR}/postgresql-init
-    sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${D_DEST_DIR}/postgresql-init
-
-    sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${D_DEST_DIR}/postgresql-init
-    sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
-
-    sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${D_DEST_DIR}/postgresql-init
-    sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
-
-    install -d ${D}${systemd_unitdir}/system/
-    PG_INIT_SERVICE_FILE=${D}${systemd_unitdir}/system/postgresql-init.service
-    install -m 644 ${WORKDIR}/postgresql-init.service ${PG_INIT_SERVICE_FILE}
-    sed -e "s:%SYSCONFIGDIR%:${sysconfdir}:g" -i ${PG_INIT_SERVICE_FILE}
-
-    # Update PGDATA throughout
-    files="${D}${localstatedir}/lib/${BPN}/.bash_profile"
-    files="$files ${D}${systemd_unitdir}/system/postgresql.service"
-    files="$files ${D}${bindir}/${BPN}-setup"
-    files="$files ${D}${sysconfdir}/init.d/${BPN}-server"
-    for f in $files
-    do
-        sed -e "s:\(PGDATA=\).*$:\1${DB_DATADIR}:g" -i $f
-    done
-
-    # Ensure DB is initialize before we attempt to start the service
-    FILE=${D}${systemd_unitdir}/system/postgresql.service
-    sed -e '/ExecStart=.*/i ExecStartPre=-${sysconfdir}/postgresql/postgresql-init initdb' -i $FILE
-    sed -e '/ExecStartPre=.*/i PermissionsStartOnly=true' -i $FILE
-}
-
-PACKAGES += " ${PN}-setup"
-
-SYSTEMD_PACKAGES += "${PN}-setup"
-SYSTEMD_SERVICE_${PN}-setup = "postgresql-init.service"
-
-FILES_${PN}-setup = " \
-    ${systemd_unitdir}/system \
-"
diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc b/meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc
new file mode 100644
index 0000000..5bf25e1
--- /dev/null
+++ b/meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc
@@ -0,0 +1,60 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+    file://postgresql-init \
+    file://postgresql-init.service \
+    "
+
+inherit identity hosts
+
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
+
+# default
+DB_DATADIR ?= "/var/lib/postgres/data"
+
+do_install_append() {
+    D_DEST_DIR=${D}${sysconfdir}/postgresql
+
+    install -d ${D_DEST_DIR}
+    install -m 0755 ${WORKDIR}/postgresql-init ${D_DEST_DIR}/postgresql-init
+
+    sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${D_DEST_DIR}/postgresql-init
+
+    sed -e "s:%DB_USER%:${DB_USER}:g" -i ${D_DEST_DIR}/postgresql-init
+    sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${D_DEST_DIR}/postgresql-init
+
+    sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${D_DEST_DIR}/postgresql-init
+    sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
+
+    sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${D_DEST_DIR}/postgresql-init
+    sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
+
+    install -d ${D}${systemd_unitdir}/system/
+    PG_INIT_SERVICE_FILE=${D}${systemd_unitdir}/system/postgresql-init.service
+    install -m 644 ${WORKDIR}/postgresql-init.service ${PG_INIT_SERVICE_FILE}
+    sed -e "s:%SYSCONFIGDIR%:${sysconfdir}:g" -i ${PG_INIT_SERVICE_FILE}
+
+    # Update PGDATA throughout
+    files="${D}${localstatedir}/lib/${BPN}/.bash_profile"
+    files="$files ${D}${systemd_unitdir}/system/postgresql.service"
+    files="$files ${D}${bindir}/${BPN}-setup"
+    files="$files ${D}${sysconfdir}/init.d/${BPN}-server"
+    for f in $files
+    do
+        sed -e "s:\(PGDATA=\).*$:\1${DB_DATADIR}:g" -i $f
+    done
+
+    # Ensure DB is initialize before we attempt to start the service
+    FILE=${D}${systemd_unitdir}/system/postgresql.service
+    sed -e '/ExecStart=.*/i ExecStartPre=-${sysconfdir}/postgresql/postgresql-init initdb' -i $FILE
+    sed -e '/ExecStartPre=.*/i PermissionsStartOnly=true' -i $FILE
+}
+
+PACKAGES += " ${PN}-setup"
+
+SYSTEMD_PACKAGES += "${PN}-setup"
+SYSTEMD_SERVICE_${PN}-setup = "postgresql-init.service"
+
+FILES_${PN}-setup = " \
+    ${systemd_unitdir}/system \
+"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking
  2018-10-11  3:50 [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking mingli.yu
  2018-10-11  3:50 ` [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx mingli.yu
  2018-10-11  3:50 ` [meta-openstack][PATCH 3/3] postgresql: make append version independent mingli.yu
@ 2018-10-11 18:47 ` Bruce Ashfield
  2018-10-12  7:07   ` Yu, Mingli
  2 siblings, 1 reply; 7+ messages in thread
From: Bruce Ashfield @ 2018-10-11 18:47 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: meta-virtualization

merged.

Note: this doesn't apply to my meta-openstack layer. So it was based
on some version that I don't have. But since the change was simple
enough, I resolved the issue and did the merge.

Bruce
On Wed, Oct 10, 2018 at 11:50 PM <mingli.yu@windriver.com> wrote:
>
> From: Mingli Yu <Mingli.Yu@windriver.com>
>
> 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>
> ---
>  meta-openstack/README                                | 19 +++++++++++++++++++
>  meta-openstack/classes/sanity-meta-openstack.bbclass | 10 ++++++++++
>  meta-openstack/conf/layer.conf                       |  4 ++++
>  3 files changed, 33 insertions(+)
>  create mode 100644 meta-openstack/classes/sanity-meta-openstack.bbclass
>
> 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 126f37f..f322bcd 100644
> --- a/meta-openstack/conf/layer.conf
> +++ b/meta-openstack/conf/layer.conf
> @@ -35,5 +35,9 @@ 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"
>  LAYERRECOMMENDS_openstack-layer = "meta-openstack-dl (= 2.6)"
> --
> 2.7.4
>


-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [meta-openstack][PATCH 3/3] postgresql: make append version independent
  2018-10-11  3:50 ` [meta-openstack][PATCH 3/3] postgresql: make append version independent mingli.yu
@ 2018-10-11 18:47   ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2018-10-11 18:47 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: meta-virtualization

merged

Bruce
On Wed, Oct 10, 2018 at 11:50 PM <mingli.yu@windriver.com> wrote:
>
> From: Mingli Yu <Mingli.Yu@windriver.com>
>
> Make bbappend version independent and only
> effective when the openstack distro enabled.
>
> Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
> ---
>  .../recipes-dbs/postgresql/postgresql_%.bbappend   |  1 +
>  .../recipes-dbs/postgresql/postgresql_9.%.bbappend | 60 ----------------------
>  .../postgresql/postgresql_openstack.inc            | 60 ++++++++++++++++++++++
>  3 files changed, 61 insertions(+), 60 deletions(-)
>  create mode 100644 meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend
>  delete mode 100644 meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend
>  create mode 100644 meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc
>
> diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend b/meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend
> new file mode 100644
> index 0000000..025ee4e
> --- /dev/null
> +++ b/meta-openstack/recipes-dbs/postgresql/postgresql_%.bbappend
> @@ -0,0 +1 @@
> +require ${@bb.utils.contains('DISTRO_FEATURES', 'openstack', '${BPN}_openstack.inc', '', d)}
> diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend b/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend
> deleted file mode 100644
> index 5bf25e1..0000000
> --- a/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend
> +++ /dev/null
> @@ -1,60 +0,0 @@
> -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> -
> -SRC_URI += " \
> -    file://postgresql-init \
> -    file://postgresql-init.service \
> -    "
> -
> -inherit identity hosts
> -
> -SYSTEMD_AUTO_ENABLE_${PN} = "enable"
> -
> -# default
> -DB_DATADIR ?= "/var/lib/postgres/data"
> -
> -do_install_append() {
> -    D_DEST_DIR=${D}${sysconfdir}/postgresql
> -
> -    install -d ${D_DEST_DIR}
> -    install -m 0755 ${WORKDIR}/postgresql-init ${D_DEST_DIR}/postgresql-init
> -
> -    sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${D_DEST_DIR}/postgresql-init
> -
> -    sed -e "s:%DB_USER%:${DB_USER}:g" -i ${D_DEST_DIR}/postgresql-init
> -    sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${D_DEST_DIR}/postgresql-init
> -
> -    sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${D_DEST_DIR}/postgresql-init
> -    sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
> -
> -    sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${D_DEST_DIR}/postgresql-init
> -    sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
> -
> -    install -d ${D}${systemd_unitdir}/system/
> -    PG_INIT_SERVICE_FILE=${D}${systemd_unitdir}/system/postgresql-init.service
> -    install -m 644 ${WORKDIR}/postgresql-init.service ${PG_INIT_SERVICE_FILE}
> -    sed -e "s:%SYSCONFIGDIR%:${sysconfdir}:g" -i ${PG_INIT_SERVICE_FILE}
> -
> -    # Update PGDATA throughout
> -    files="${D}${localstatedir}/lib/${BPN}/.bash_profile"
> -    files="$files ${D}${systemd_unitdir}/system/postgresql.service"
> -    files="$files ${D}${bindir}/${BPN}-setup"
> -    files="$files ${D}${sysconfdir}/init.d/${BPN}-server"
> -    for f in $files
> -    do
> -        sed -e "s:\(PGDATA=\).*$:\1${DB_DATADIR}:g" -i $f
> -    done
> -
> -    # Ensure DB is initialize before we attempt to start the service
> -    FILE=${D}${systemd_unitdir}/system/postgresql.service
> -    sed -e '/ExecStart=.*/i ExecStartPre=-${sysconfdir}/postgresql/postgresql-init initdb' -i $FILE
> -    sed -e '/ExecStartPre=.*/i PermissionsStartOnly=true' -i $FILE
> -}
> -
> -PACKAGES += " ${PN}-setup"
> -
> -SYSTEMD_PACKAGES += "${PN}-setup"
> -SYSTEMD_SERVICE_${PN}-setup = "postgresql-init.service"
> -
> -FILES_${PN}-setup = " \
> -    ${systemd_unitdir}/system \
> -"
> diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc b/meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc
> new file mode 100644
> index 0000000..5bf25e1
> --- /dev/null
> +++ b/meta-openstack/recipes-dbs/postgresql/postgresql_openstack.inc
> @@ -0,0 +1,60 @@
> +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
> +
> +SRC_URI += " \
> +    file://postgresql-init \
> +    file://postgresql-init.service \
> +    "
> +
> +inherit identity hosts
> +
> +SYSTEMD_AUTO_ENABLE_${PN} = "enable"
> +
> +# default
> +DB_DATADIR ?= "/var/lib/postgres/data"
> +
> +do_install_append() {
> +    D_DEST_DIR=${D}${sysconfdir}/postgresql
> +
> +    install -d ${D_DEST_DIR}
> +    install -m 0755 ${WORKDIR}/postgresql-init ${D_DEST_DIR}/postgresql-init
> +
> +    sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${D_DEST_DIR}/postgresql-init
> +
> +    sed -e "s:%DB_USER%:${DB_USER}:g" -i ${D_DEST_DIR}/postgresql-init
> +    sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${D_DEST_DIR}/postgresql-init
> +
> +    sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${D_DEST_DIR}/postgresql-init
> +    sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
> +
> +    sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${D_DEST_DIR}/postgresql-init
> +    sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${D_DEST_DIR}/postgresql-init
> +
> +    install -d ${D}${systemd_unitdir}/system/
> +    PG_INIT_SERVICE_FILE=${D}${systemd_unitdir}/system/postgresql-init.service
> +    install -m 644 ${WORKDIR}/postgresql-init.service ${PG_INIT_SERVICE_FILE}
> +    sed -e "s:%SYSCONFIGDIR%:${sysconfdir}:g" -i ${PG_INIT_SERVICE_FILE}
> +
> +    # Update PGDATA throughout
> +    files="${D}${localstatedir}/lib/${BPN}/.bash_profile"
> +    files="$files ${D}${systemd_unitdir}/system/postgresql.service"
> +    files="$files ${D}${bindir}/${BPN}-setup"
> +    files="$files ${D}${sysconfdir}/init.d/${BPN}-server"
> +    for f in $files
> +    do
> +        sed -e "s:\(PGDATA=\).*$:\1${DB_DATADIR}:g" -i $f
> +    done
> +
> +    # Ensure DB is initialize before we attempt to start the service
> +    FILE=${D}${systemd_unitdir}/system/postgresql.service
> +    sed -e '/ExecStart=.*/i ExecStartPre=-${sysconfdir}/postgresql/postgresql-init initdb' -i $FILE
> +    sed -e '/ExecStartPre=.*/i PermissionsStartOnly=true' -i $FILE
> +}
> +
> +PACKAGES += " ${PN}-setup"
> +
> +SYSTEMD_PACKAGES += "${PN}-setup"
> +SYSTEMD_SERVICE_${PN}-setup = "postgresql-init.service"
> +
> +FILES_${PN}-setup = " \
> +    ${systemd_unitdir}/system \
> +"
> --
> 2.7.4
>


-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx
  2018-10-11  3:50 ` [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx mingli.yu
@ 2018-10-11 18:47   ` Bruce Ashfield
  0 siblings, 0 replies; 7+ messages in thread
From: Bruce Ashfield @ 2018-10-11 18:47 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: meta-virtualization

merged

Bruce
On Wed, Oct 10, 2018 at 11:51 PM <mingli.yu@windriver.com> wrote:
>
> From: Mingli Yu <Mingli.Yu@windriver.com>
>
> Only set PREFERRED_VERSION for python-networkx
> when the openstack distro is enabled
>
> Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
> ---
>  meta-openstack/conf/layer.conf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta-openstack/conf/layer.conf b/meta-openstack/conf/layer.conf
> index f322bcd..598e157 100644
> --- a/meta-openstack/conf/layer.conf
> +++ b/meta-openstack/conf/layer.conf
> @@ -32,7 +32,7 @@ PREFERRED_VERSION_python-sqlalchemy = "1.0.16"
>  PREFERRED_VERSION_python-eventlet = "0.20.0"
>  PREFERRED_VERSION_python-warlock = "1.2.0"
>  PREFERRED_VERSION_python-jsonschema = "2.6.0"
> -PREFERRED_VERSION_python-networkx = "1.11"
> +PREFERRED_VERSION_python-networkx = "${@bb.utils.contains('DISTRO_FEATURES', 'openstack', '1.11', '', d)}"
>  PREFERRED_VERSION_python-oslo.i18n = "3.17.0+gitAUTOINC+f2729cd36f"
>
>  # Sanity check for meta-openstack layer.
> --
> 2.7.4
>


-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking
  2018-10-11 18:47 ` [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking Bruce Ashfield
@ 2018-10-12  7:07   ` Yu, Mingli
  0 siblings, 0 replies; 7+ messages in thread
From: Yu, Mingli @ 2018-10-12  7:07 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization



On 2018年10月12日 02:47, Bruce Ashfield wrote:
> merged.
>
> Note: this doesn't apply to my meta-openstack layer. So it was based
> on some version that I don't have. But since the change was simple
> enough, I resolved the issue and did the merge.

Thanks Bruce!

>
> Bruce
> On Wed, Oct 10, 2018 at 11:50 PM <mingli.yu@windriver.com> wrote:
>>
>> From: Mingli Yu <Mingli.Yu@windriver.com>
>>
>> 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>
>> ---
>>   meta-openstack/README                                | 19 +++++++++++++++++++
>>   meta-openstack/classes/sanity-meta-openstack.bbclass | 10 ++++++++++
>>   meta-openstack/conf/layer.conf                       |  4 ++++
>>   3 files changed, 33 insertions(+)
>>   create mode 100644 meta-openstack/classes/sanity-meta-openstack.bbclass
>>
>> 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 126f37f..f322bcd 100644
>> --- a/meta-openstack/conf/layer.conf
>> +++ b/meta-openstack/conf/layer.conf
>> @@ -35,5 +35,9 @@ 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"
>>   LAYERRECOMMENDS_openstack-layer = "meta-openstack-dl (= 2.6)"
>> --
>> 2.7.4
>>
>
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-12  7:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11  3:50 [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking mingli.yu
2018-10-11  3:50 ` [meta-openstack][PATCH v2 2/3] layer.conf: set PREFERRED_VERSION for python-networkx mingli.yu
2018-10-11 18:47   ` Bruce Ashfield
2018-10-11  3:50 ` [meta-openstack][PATCH 3/3] postgresql: make append version independent mingli.yu
2018-10-11 18:47   ` Bruce Ashfield
2018-10-11 18:47 ` [meta-openstack][PATCH 1/3] sanity-meta-openstack.bbclass: add class for bbappend files checking Bruce Ashfield
2018-10-12  7:07   ` Yu, Mingli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.