diff -Nru neutron-dynamic-routing-13.0.0/debian/changelog neutron-dynamic-routing-13.0.0/debian/changelog --- neutron-dynamic-routing-13.0.0/debian/changelog 2018-09-05 20:29:38.000000000 +0200 +++ neutron-dynamic-routing-13.0.0/debian/changelog 2019-03-13 11:54:44.000000000 +0100 @@ -1,3 +1,15 @@ +neutron-dynamic-routing (2:13.0.0-2) unstable; urgency=medium + + * d/control: Add me to uploaders field + * d/neutron-bgp-dragent.init.in: + - Add agent.conf.d configdir as it is in other neutron's plugins + * d/rules: Fix default config + * Fix db migration if user set config via debconf (Closes: #924476). + * Router id is now configurable via debconf + * Nothing changed if used non-interactive-mode + + -- Michal Arbet Wed, 13 Mar 2019 11:54:44 +0100 + neutron-dynamic-routing (2:13.0.0-1) unstable; urgency=medium * New upstream release. diff -Nru neutron-dynamic-routing-13.0.0/debian/control neutron-dynamic-routing-13.0.0/debian/control --- neutron-dynamic-routing-13.0.0/debian/control 2018-09-05 20:29:38.000000000 +0200 +++ neutron-dynamic-routing-13.0.0/debian/control 2019-03-13 11:54:44.000000000 +0100 @@ -4,6 +4,7 @@ Maintainer: Debian OpenStack Uploaders: Thomas Goirand , + Michal Arbet , Build-Depends: debhelper (>= 10), dh-python, diff -Nru neutron-dynamic-routing-13.0.0/debian/neutron-bgp-dragent.init.in neutron-dynamic-routing-13.0.0/debian/neutron-bgp-dragent.init.in --- neutron-dynamic-routing-13.0.0/debian/neutron-bgp-dragent.init.in 2018-09-05 20:29:38.000000000 +0200 +++ neutron-dynamic-routing-13.0.0/debian/neutron-bgp-dragent.init.in 2019-03-13 11:54:44.000000000 +0100 @@ -18,3 +18,8 @@ # --config-file=/etc/neutron/neutron.conf will be happened # to DAEMON_ARGS later by openstack-pkg-tools DAEMON_ARGS="--config-file=/etc/neutron/bgp_dragent.ini" + +# Load agent side config files +if [ -e /etc/neutron/agent.conf.d ] ; then + DAEMON_ARGS="--config-dir=/etc/neutron/agent.conf.d ${DAEMON_ARGS}" +fi diff -Nru neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.config.in neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.config.in --- neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.config.in 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.config.in 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1,31 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +BGP_AGENT_CONF="/etc/neutron/bgp_dragent.ini" + +#PKGOS-INCLUDE# + +manage_router_id() { + pkgos_inifile get ${BGP_AGENT_CONF} bgp bgp_router_id + if [ -n "${RET}" ] && [ ! "${RET}" = "NOT_FOUND" ] ; then + db_set neutron-dynamic-routing/router-id "${RET}" + else + DEFROUTE_IF=`awk '{ if ( $2 == "00000000" ) print $1 }' /proc/net/route | head -n 1` + if [ -n "${DEFROUTE_IF}" ] ; then + DEFROUTE_IP=`LC_ALL=C ip addr show "${DEFROUTE_IF}" | grep inet | head -n 1 | awk '{print $2}' | cut -d/ -f1 | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'` + if [ -n "${DEFROUTE_IP}" ] ; then + db_set neutron-dynamic-routing/router-id ${DEFROUTE_IP} + fi + fi + fi + db_input high neutron-dynamic-routing/router-id || true + db_go +} + +# Ask user if he wants db migration +db_input high neutron-dynamic-routing/configure-dynamic-routing || true +manage_router_id +db_go || true diff -Nru neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.links neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.links --- neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.links 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.links 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1 @@ +/etc/neutron/bgp_dragent.ini /etc/neutron/agent.conf.d/bgp_dragent.ini.conf diff -Nru neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.postinst.in neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.postinst.in --- neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.postinst.in 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.postinst.in 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1,53 @@ +#!/bin/sh + +set -e + +NEUTRON_CONF="/etc/neutron/neutron.conf" +BGP_AGENT_CONF="/etc/neutron/bgp_dragent.ini" + +#PKGOS-INCLUDE# + +run_db_sync (){ + + # Check if we are on server side of neutron + if [ -e /etc/init.d/neutron-rpc-server ] || systemctl -q is-enabled neutron-rpc-server.service ; then + # We have to check if connection is set in [database] config + pkgos_inifile get ${NEUTRON_CONF} database connection + if echo ${RET} | egrep 'mysql(\+pymysql)?:.*:.*@.*\/.*' > /dev/null; then + echo "===> python3-neutron-dynamic-routing-common: Now running \"neutron-db-manage --subproject neutron-dynamic-routing upgrade head\", this may take a while..." + su neutron -s /bin/sh -c "neutron-db-manage --subproject neutron-dynamic-routing upgrade head" || true + else + echo "===> neutron-dynamic-routing-common: \"neutron-db-manage --subproject neutron-dynamic-routing upgrade head\" needs database.connection set. Sorry." + fi + fi + +} + +manage_router_id() { + db_get neutron-dynamic-routing/router-id + if [ -n "${RET}" ] ; then + pkgos_inifile set ${BGP_AGENT_CONF} bgp bgp_router_id ${RET} + fi +} + +if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then + . /usr/share/debconf/confmodule + + db_get neutron-dynamic-routing/configure-dynamic-routing + if [ "$RET" = "true" ]; then + run_db_sync + # Enable service_plugin bgp + if which neutron-plugin-manage > /dev/null ; then + neutron-plugin-manage enable --service-plugin bgp + fi + manage_router_id + fi + + db_unregister neutron-dynamic-routing/configure-dynamic-routing + db_stop +fi + +#DEBHELPER# + +exit 0 + diff -Nru neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.prerm neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.prerm --- neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.prerm 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.prerm 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +#PKGOS-INCLUDE# + +if [ "$1" = "remove" ] ; then + # Disable neutron plugin + if which neutron-plugin-manage > /dev/null ; then + neutron-plugin-manage disable --service-plugin bgp + fi +fi + +#DEBHELPER# + +exit 0 diff -Nru neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.templates neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.templates --- neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.templates 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/neutron-dynamic-routing-common.templates 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1,24 @@ +Template: neutron-dynamic-routing/configure-dynamic-routing +Type: boolean +Default: false +_Description: Run default configuration for neutron-dynamic-routing ? + If you want to run now, please make sure you have configured + database.connection in neutron.conf. Database migrations will be executed. + . + If you don't choose this option, no database migration will be run + and no plugin will be enabled, these things you have to do manually. + . + You can change this setting later on by running "dpkg-reconfigure + -plow python3-neutron-fwaas". + +Template: neutron-dynamic-routing/router-id +Type: string +Default: 192.168.0.2 +_Description: Neutron-dynamic-routing router-id: + Neutron-dynamic-routing needs to be able to communicate with remote BGP system. Therefore + Neutron-dynamic-routing needs to know local BGP router id. Please fill router id with + a suitable unique 32-bit number, typically an IPv4 address on the host running the agent. + For example, 192.168.0.2. + . + Please enter the local BGP router id. + diff -Nru neutron-dynamic-routing-13.0.0/debian/po/POTFILES.in neutron-dynamic-routing-13.0.0/debian/po/POTFILES.in --- neutron-dynamic-routing-13.0.0/debian/po/POTFILES.in 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/po/POTFILES.in 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1 @@ +[type: gettext/rfc822deb] neutron-dynamic-routing-common.templates diff -Nru neutron-dynamic-routing-13.0.0/debian/po/templates.pot neutron-dynamic-routing-13.0.0/debian/po/templates.pot --- neutron-dynamic-routing-13.0.0/debian/po/templates.pot 1970-01-01 01:00:00.000000000 +0100 +++ neutron-dynamic-routing-13.0.0/debian/po/templates.pot 2019-03-13 11:54:44.000000000 +0100 @@ -0,0 +1,70 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the neutron-dynamic-routing package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: neutron-dynamic-routing\n" +"Report-Msgid-Bugs-To: neutron-dynamic-routing@packages.debian.org\n" +"POT-Creation-Date: 2019-03-14 16:24+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../neutron-dynamic-routing-common.templates:1001 +msgid "Run default configuration for neutron-dynamic-routing ?" +msgstr "" + +#. Type: boolean +#. Description +#: ../neutron-dynamic-routing-common.templates:1001 +msgid "" +"If you want to run now, please make sure you have configured database." +"connection in neutron.conf. Database migrations will be executed." +msgstr "" + +#. Type: boolean +#. Description +#: ../neutron-dynamic-routing-common.templates:1001 +msgid "" +"If you don't choose this option, no database migration will be run and no " +"plugin will be enabled, these things you have to do manually." +msgstr "" + +#. Type: boolean +#. Description +#: ../neutron-dynamic-routing-common.templates:1001 +msgid "" +"You can change this setting later on by running \"dpkg-reconfigure -plow " +"python3-neutron-fwaas\"." +msgstr "" + +#. Type: string +#. Description +#: ../neutron-dynamic-routing-common.templates:2001 +msgid "Neutron-dynamic-routing router-id:" +msgstr "" + +#. Type: string +#. Description +#: ../neutron-dynamic-routing-common.templates:2001 +msgid "" +"Neutron-dynamic-routing needs to be able to communicate with remote BGP " +"system. Therefore Neutron-dynamic-routing needs to know local BGP router id. " +"Please fill router id with a suitable unique 32-bit number, typically an " +"IPv4 address on the host running the agent. For example, 192.168.0.2." +msgstr "" + +#. Type: string +#. Description +#: ../neutron-dynamic-routing-common.templates:2001 +msgid "Please enter the local BGP router id." +msgstr "" diff -Nru neutron-dynamic-routing-13.0.0/debian/rules neutron-dynamic-routing-13.0.0/debian/rules --- neutron-dynamic-routing-13.0.0/debian/rules 2018-09-05 20:29:38.000000000 +0200 +++ neutron-dynamic-routing-13.0.0/debian/rules 2019-03-13 11:54:44.000000000 +0100 @@ -16,7 +16,8 @@ rm -rf build override_dh_auto_build: - echo "Do nothing..." + /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-dynamic-routing-common.config + /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-dynamic-routing-common.postinst override_dh_auto_install: echo "Do nothing..." @@ -37,6 +38,11 @@ --namespace bgp.agent rm -rf $(CURDIR)/debian/tmp/usr/etc + + # Fix bgp_speaker_driver + # neutron_dynamic_routing.services.bgp.agent.driver.ryu.driver.RyuBgpDriver is currently only one and should be default + pkgos-fix-config-default $(CURDIR)/debian/neutron-dynamic-routing-common/etc/neutron/bgp_dragent.ini bgp bgp_speaker_driver neutron_dynamic_routing.services.bgp.agent.driver.ryu.driver.RyuBgpDriver + dh_install dh_missing --fail-missing