From b27164f0a834b63b241ae9141bd9c40fad2cf1e0 Mon Sep 17 00:00:00 2001 From: Nguyen Phuong An Date: Thu, 10 Nov 2016 18:01:35 +0700 Subject: [PATCH] [log]: Devstack plugin for logging api This patch implements devstack plugin for logging api. The logging api service base on logging api spec [1]. [1] https://specs.openstack.org/openstack/neutron-specs/specs/pike/logging-API-for-security-group-rules.html Change-Id: Ib86535ad24319cb0e10a48df50651264201673c3 Depends-On: Ib8668dd25ee7c5000a6dafcc7db3dbc33ad190be Partially-implements: blueprint security-group-logging Related-Bug: #1468366 --- devstack/lib/log | 12 ++++++++++++ devstack/plugin.sh | 4 ++++ neutron/tests/contrib/gate_hook.sh | 1 + neutron/tests/contrib/hooks/api_all_extensions | 1 + neutron/tests/contrib/hooks/log | 6 ++++++ 5 files changed, 24 insertions(+) create mode 100644 devstack/lib/log create mode 100644 neutron/tests/contrib/hooks/log diff --git a/devstack/lib/log b/devstack/lib/log new file mode 100644 index 00000000000..635fcfe6c74 --- /dev/null +++ b/devstack/lib/log @@ -0,0 +1,12 @@ +function configure_log_service_plugin { + neutron_service_plugin_class_add "log" +} + +function configure_log_extension { + plugin_agent_add_l2_agent_extension "log" +} + +function configure_log { + configure_log_service_plugin + configure_log_extension +} diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 3d6452ffc72..77488ce03dd 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -9,6 +9,7 @@ source $LIBDIR/qos source $LIBDIR/ovs source $LIBDIR/segments source $LIBDIR/trunk +source $LIBDIR/log Q_BUILD_OVS_FROM_GIT=$(trueorfalse False Q_BUILD_OVS_FROM_GIT) @@ -36,6 +37,9 @@ if [[ "$1" == "stack" ]]; then if is_service_enabled q-trunk neutron-trunk; then configure_trunk_extension fi + if is_service_enabled q-log neutron-log; then + configure_log + fi if is_service_enabled q-dns neutron-dns; then configure_dns_extension post_config_dns_extension diff --git a/neutron/tests/contrib/gate_hook.sh b/neutron/tests/contrib/gate_hook.sh index dd850f72763..4b9c816571d 100644 --- a/neutron/tests/contrib/gate_hook.sh +++ b/neutron/tests/contrib/gate_hook.sh @@ -96,6 +96,7 @@ case $VENV in fi load_conf_hook quotas load_rc_hook dns + load_rc_hook log load_rc_hook qos load_rc_hook segments load_rc_hook trunk diff --git a/neutron/tests/contrib/hooks/api_all_extensions b/neutron/tests/contrib/hooks/api_all_extensions index c9075a32ac4..390a7d61d2a 100644 --- a/neutron/tests/contrib/hooks/api_all_extensions +++ b/neutron/tests/contrib/hooks/api_all_extensions @@ -18,6 +18,7 @@ NETWORK_API_EXTENSIONS+=",flavors" NETWORK_API_EXTENSIONS+=",l3-flavors" NETWORK_API_EXTENSIONS+=",l3-ha" NETWORK_API_EXTENSIONS+=",l3_agent_scheduler" +NETWORK_API_EXTENSIONS+=",logging" NETWORK_API_EXTENSIONS+=",metering" NETWORK_API_EXTENSIONS+=",multi-provider" NETWORK_API_EXTENSIONS+=",net-mtu" diff --git a/neutron/tests/contrib/hooks/log b/neutron/tests/contrib/hooks/log new file mode 100644 index 00000000000..774b2a436a1 --- /dev/null +++ b/neutron/tests/contrib/hooks/log @@ -0,0 +1,6 @@ +enable_service neutron-log + +[[post-config|/$NEUTRON_CORE_PLUGIN_CONF]] + +[network_log] +local_output_log_base = /tmp/test_log.log