File openstack-neutron.spec of Package openstack-neutron

#
# spec file for package openstack-neutron
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define component neutron
%define groupname %{component}
%define username %{component}

%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif

%define version_unconverted 8.0.0.0rc3.dev10

%if 0%{?suse_version} > 1230 || 0%{?rhel} > 6
%define using_systemd 1
%else
%define using_systemd 0
%endif

Name:           openstack-neutron
Version:        8.0.0.0~rc3~dev10
Release:        0
Summary:        OpenStack Network
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/neutron
Source:         http://tarballs.openstack.org/neutron/neutron-stable-mitaka.tar.gz
Source1:        openstack-%{component}.init
Source2:        %{name}.logrotate
Source3:        neutron-sudoers
Source4:        openstack-%{component}-plugin.init
Source5:        sysconfig.neutron
Source6:        openstack-%{component}-ovs-cleanup.init
%if 0%{?using_systemd}
Source10:       %name.conf
BuildRequires:  systemd
%endif
Source20:       https://raw.githubusercontent.com/SUSE-Cloud/cookbook-openstack-network/neutron-ha-tool-maintenance/files/default/neutron-ha-tool.py
Source99:       rpmlintrc
BuildRequires:  crudini
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
BuildRequires:  openstack-suse-sudo
BuildRequires:  python-devel
BuildRequires:  python-pbr
# Documentation/sample config build requirements:
BuildRequires:  python-Sphinx
BuildRequires:  python-debtcollector
BuildRequires:  python-keystoneauth1
BuildRequires:  python-neutron-lib
BuildRequires:  python-novaclient
BuildRequires:  python-oslo.config
BuildRequires:  python-oslo.db
BuildRequires:  python-oslo.i18n
BuildRequires:  python-oslo.log
BuildRequires:  python-oslo.messaging
BuildRequires:  python-oslo.policy
BuildRequires:  python-oslo.rootwrap
BuildRequires:  python-oslosphinx
BuildRequires:  python-pecan
BuildRequires:  python-six
Requires:       logrotate
Requires:       openstack-suse-sudo
Requires:       python >= 2.6.8
Requires:       python-neutron = %{version}
%if 0%{?suse_version}
Requires(pre):  pwdutils
%else
Requires(pre):  /usr/bin/getent /usr/sbin/useradd /usr/sbin/userdel /usr/sbin/groupadd /usr/sbin/groupdel
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%py_requires
%else
BuildArch:      noarch
%endif
PreReq:         %fillup_prereq

%description
Neutron is a virtual network service for Openstack.

Just like OpenStack Nova provides an API to dynamically request and
configure virtual servers, Neutron provides an API to dynamically
request and configure virtual networks. These networks connect
"interfaces" from other OpenStack services (e.g., vNICs from Nova VMs).
The Neutron API supports extensions to provide advanced network
capabilities (e.g., QoS, ACLs, network monitoring, etc)

%package -n python-neutron
Summary:        OpenStack Network - Python module
Group:          Development/Languages/Python
Requires:       python >= 2.6.8
Requires:       python-Jinja2 >= 2.8
Requires:       python-Paste
Requires:       python-PasteDeploy >= 1.5.0
Requires:       python-Routes >= 1.12.3
Requires:       python-SQLAlchemy >= 1.0.10
# WMI is only needed on windows
#Requires:       python-WMI
Requires:       python-WebOb >= 1.2.3
Requires:       python-alembic >= 0.8.0
Requires:       python-debtcollector >= 1.2.0
Requires:       python-eventlet >= 0.18.2
Requires:       python-greenlet >= 0.3.2
Requires:       python-httplib2 >= 0.7.5
Requires:       python-keystoneauth1 >= 2.1.0
Requires:       python-keystonemiddleware >= 4.0.0
Requires:       python-netaddr >= 0.7.12
Requires:       python-neutron-lib >= 0.0.1
Requires:       python-neutronclient >= 2.6.0
Requires:       python-novaclient >= 2.29.0
Requires:       python-oslo.concurrency >= 3.5.0
Requires:       python-oslo.config >= 3.7.0
Requires:       python-oslo.context >= 0.2.0
Requires:       python-oslo.db >= 4.1.0
Requires:       python-oslo.i18n >= 2.1.0
Requires:       python-oslo.log >= 1.14.0
Requires:       python-oslo.messaging >= 4.0.0
Requires:       python-oslo.middleware >= 3.0.0
Requires:       python-oslo.policy >= 0.5.0
Requires:       python-oslo.reports >= 0.6.0
Requires:       python-oslo.rootwrap >= 2.0.0
Requires:       python-oslo.serialization >= 1.10.0
Requires:       python-oslo.service >= 1.0.0
Requires:       python-oslo.utils >= 3.5.0
Requires:       python-oslo.versionedobjects >= 1.5.0
Requires:       python-ovs >= 2.4.0
Requires:       python-pbr >= 1.6
Requires:       python-pecan >= 1.0.0
Requires:       python-requests >= 2.8.1
Requires:       python-retrying >= 1.2.3
Requires:       python-ryu >= 3.30
Requires:       python-six >= 1.9.0
Requires:       python-stevedore >= 1.5.0

%description -n python-neutron
This package contains the core Python module of OpenStack Neutron.

%package server
Summary:        OpenStack Network - Python module
Group:          Development/Languages/Python
PreReq:         %name = %version

%description server
This package provides the Neutron server

%package dhcp-agent
Summary:        OpenStack Network - DHCP Agent
Group:          Development/Languages/Python
PreReq:         %name = %version
Requires:       dnsmasq >= 2.63
%if 0%{?suse_version} >= 1310
Requires:       dnsmasq-utils
%endif

%description dhcp-agent
This package provides the DHCP Agent.

%package l3-agent
Summary:        OpenStack Network Service (Neutron) - L3 Agent
Group:          Development/Languages/Python
PreReq:         %name = %version
Requires:       conntrack-tools

%description l3-agent
This package provides the L3 Agent.

%package linuxbridge-agent
Summary:        OpenStack Network - Linux Bridge Agent
Group:          Development/Languages/Python
Provides:       openstack-neutron-agent = %version
PreReq:         %name = %version
Requires:       conntrack-tools
Requires:       ebtables
Requires:       ipset
Requires:       iptables

%description linuxbridge-agent
This package provides the Linux Bridge Agent.

%package metadata-agent
Summary:        OpenStack Network - Meta Data Agent
Group:          Development/Languages/Python
PreReq:         %name = %version

%description metadata-agent
This package provides the Meta Data Agent.

%package metering-agent
Summary:        OpenStack Network - Metering Agent
Group:          Development/Languages/Python
PreReq:         %name = %version

%description metering-agent
This package provides the Metering Agent.

#%package mlnx-agent
#Summary:        OpenStack Network - Mellanox Plugin
#Group:          Development/Languages/Python
#PreReq:         %name = %version
#Provides:       openstack-quantum-mlnx-agent = 2013.2.0
#Obsoletes:      openstack-quantum-mlnx-agent < 2013.2.0

#%description mlnx-agent
#This package provides the Mellanox Agent

#%package ofagent-agent
#Summary:        OpenStack Network - ofagent Agent
#Group:          Development/Languages/Python
#Provides:       openstack-neutron-agent = %version
#PreReq:         %name = %version
#
#%description ofagent-agent
#This package provides the ofagent Agent.
#

%package openvswitch-agent
Summary:        OpenStack Network - Open vSwitch
Group:          Development/Languages/Python
Provides:       openstack-neutron-agent = %version
PreReq:         %name = %version
Requires:       conntrack-tools
Requires:       ipset
Requires:       iptables
Requires:       openvswitch-switch

%description openvswitch-agent
This package provides the OpenVSwitch Agent.

%package macvtap-agent
Summary:        OpenStack Network - macvtap
Group:          Development/Languages/Python
PreReq:         %name = %version

%description macvtap-agent
This package provides the macvtap Agent.

%package bgp-dragent
Summary:        OpenStack Network - bgp-dr
Group:          Development/Languages/Python
PreReq:         %name = %version

%description bgp-dragent
This package provides the bgp-dr Agent.

%package test
Summary:        OpenStack Network - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-WebTest >= 2.0
Requires:       python-cliff >= 1.15.0
Requires:       python-ddt >= 1.0.1
Requires:       python-fixtures >= 1.3.1
Requires:       python-mock >= 1.2
Requires:       python-os-testr >= 0.4.1
Requires:       python-oslotest >= 1.10.0
Requires:       python-python-subunit >= 0.0.18
Requires:       python-requests-mock >= 0.7.0
Requires:       python-testrepository >= 0.0.18
Requires:       python-testresources >= 0.2.4
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 1.4.0

%description test
The OpenStack Neutron testsuite. It is used to verify the functionality
of OpenStack Neutron.

%package ha-tool
Summary:        OpenStack Network - HA tool for L3 agent
Group:          Development/Languages/Python
Requires:       python-neutronclient >= 2.6.0
Requires:       python-retrying >= 1.2.3

%description ha-tool
This package provides a high availability tool for neutron networking that is
able to find offline l3 agents and migrate them to another online agents.

%prep
%setup -q -n %{component}-%{version_unconverted}
%openstack_cleanup_prep

%build
cp %{SOURCE20} .
python setup.py build
python setup.py build_sphinx -b man

PYTHONPATH=. tools/generate_config_file_samples.sh

%install
python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot} --install-data=/

### directories
install -d -m 755 %{buildroot}%{_localstatedir}/{lib,log}/%{component}
install -d -m 750 %{buildroot}%{_localstatedir}/cache/%{component}
install -d -m 700 %{buildroot}%{_rundir}/%{component}
%if 0%{?using_systemd}
install -D -m 644 %{SOURCE10} %{buildroot}/%_tmpfilesdir/%name.conf
%endif

### configuration files
for c in neutron.conf dhcp_agent.ini l3_agent.ini metadata_agent.ini metering_agent.ini bgp_dragent.ini ; do
    install -p -D -m 644 etc/$c.sample %{buildroot}%{_sysconfdir}/%{component}/$c
done
for c in linuxbridge_agent.ini ml2_conf.ini ml2_conf_sriov.ini openvswitch_agent.ini sriov_agent.ini macvtap_agent.ini ; do
    install -p -D -m 644 etc/neutron/plugins/ml2/$c.sample %{buildroot}%{_sysconfdir}/%{component}/plugins/ml2/$c
done
install -d -m 755 %{buildroot}%{_sysconfdir}/%{component}
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

### init scripts
# the actual %%_initddir is distro-specific!
install -p -D -m 755 %{SOURCE1} %{buildroot}%{_initddir}/openstack-%{component}
mkdir -p %{buildroot}%{_sbindir}
ln -s ../..%{_initddir}/openstack-%{component} %{buildroot}%{_sbindir}/rcopenstack-%{component}

agents=(\
     l3-agent \
     dhcp-agent \
     openvswitch-agent \
     linuxbridge-agent \
     metadata-agent \
     metering-agent \
     bgp-dragent \
     macvtap-agent
)
agentPaths=(
     /etc/%{component}/l3_agent.ini \
     /etc/%{component}/dhcp_agent.ini  \
     /etc/%{component}/plugins/ml2/openvswitch_agent.ini \
     /etc/%{component}/plugins/ml2/linuxbridge_agent.ini \
     /etc/%{component}/metadata_agent.ini \
     /etc/%{component}/metering_agent.ini \
     /etc/%{component}/bgp_dragent.ini \
     /etc/%{component}/plugins/ml2/macvtap_agent.ini
)
agentExtra=(
     /etc/%{component}/fwaas_driver.ini
)

for i in ${!agents[@]} ; do
  install -D -m 755 %{SOURCE4} %{buildroot}%{_initddir}/openstack-%{component}-${agents[$i]}
  sed -i -e "s,__NAME__,${agents[$i]},g" %{buildroot}%{_initddir}/openstack-%{component}-${agents[$i]}
  if [ ! -z ${agentPaths[$i]} ] ; then
    sed -i -e "s,__PLUGIN_CONFFILE__,${agentPaths[$i]},g" %{buildroot}%{_initddir}/openstack-%{component}-${agents[$i]}
  else
    sed -i -e "s,__PLUGIN_CONFFILE__,,g" %{buildroot}%{_initddir}/openstack-%{component}-${agents[$i]}
  fi
  sed -i -e "s,__PLUGIN_OPT_CONFFILES__,${agentExtra[$i]},g" %{buildroot}%{_initddir}/openstack-%{component}-${agents[$i]}
  ln -s ../..%{_initddir}/openstack-%{component}-${agents[$i]} %{buildroot}%{_sbindir}/rcopenstack-%{component}-${agents[$i]}
done

install -D -m 755 %{SOURCE6} %{buildroot}%{_initddir}/openstack-%{component}-ovs-cleanup
ln -s ../..%{_initddir}/openstack-%{component}-ovs-cleanup %{buildroot}%{_sbindir}/rcopenstack-%{component}-ovs-cleanup

### sudoers configuration for nova-rootwrap:
install -D -m 440 %{SOURCE3} %{buildroot}%{_sysconfdir}/sudoers.d/openstack-neutron

### documentation
install -d %{buildroot}%{_mandir}/man1
install -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1

## SUSE configuration defaults
%define neutron_conf %{buildroot}/etc/neutron/neutron.conf
%define plugin_dir %{buildroot}/etc/neutron/plugins/
crudini --set %{neutron_conf} DEFAULT verbose True
crudini --set %{neutron_conf} DEFAULT core_plugin neutron.plugins.ml2.plugin.Ml2Plugin
crudini --set %{neutron_conf} DEFAULT service_plugins "neutron.services.l3_router.l3_router_plugin.L3RouterPlugin"
crudini --set %{neutron_conf} DEFAULT state_path /var/lib/neutron
crudini --set %{neutron_conf} agent root_helper "sudo neutron-rootwrap /etc/neutron/rootwrap.conf"
crudini --set %{neutron_conf} DEFAULT log_dir /var/log/neutron
crudini --set %{neutron_conf} oslo_concurrency lock_path /var/run/%component
crudini --set %{neutron_conf} keystone_authtoken signing_dir /var/cache/%component/keystone-signing
for i in dhcp_agent.ini l3_agent.ini ; do
  crudini --set %{buildroot}/etc/neutron/$i DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
done
crudini --set %{buildroot}/etc/neutron/dhcp_agent.ini DEFAULT dhcp_delete_namespaces True

crudini --set %{buildroot}/etc/neutron/l3_agent.ini DEFAULT external_network_bridge "br-ex"
crudini --set %{buildroot}/etc/neutron/l3_agent.ini DEFAULT external_network_bridge ""
crudini --set %plugin_dir/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge
crudini --set %plugin_dir/ml2/ml2_conf.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
crudini --set %plugin_dir/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

### test subpackage
%openstack_test_package_install
%fdupes %{buildroot}%{_localstatedir}/lib/%{name}-test

#TODO/FIXME: there's an upstream discussion on how to install these,
# it's related to setuptools_git / MANIFEST.in issues.
for i in \
         neutron/tests/etc/api-paste.ini.test \
         ; do
    install -m 0644 -D $i %{buildroot}%{python_sitelib}/$i
done

### ha tool
install -m 755 neutron-ha-tool.py %{buildroot}%{_bindir}/neutron-ha-tool

### sysconfig

install -d -m 755 %{buildroot}/var/adm/fillup-templates
install -m 644 %{S:5} %{buildroot}/var/adm/fillup-templates

### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%fdupes %{buildroot}%{_bindir}

### authentication cache dir
mkdir -p %{buildroot}%{_localstatedir}/cache/%{component}

%pre
%openstack_pre_user_group_create %{username} %{groupname}

%post server
%{fillup_and_insserv -f openstack-%{component}}

%preun server
%stop_on_removal openstack-%{component}

%postun server
%restart_on_update openstack-%{component}
%insserv_cleanup

%post
%{fillup_only -n neutron}

%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config %{_sysconfdir}/sudoers.d/openstack-neutron
%dir %{_sysconfdir}/%{component}
%config(noreplace) %{_sysconfdir}/%{component}/api-paste.ini
%config %{_sysconfdir}/%{component}/policy.json
%config(noreplace) %attr(0640, root, %{groupname}) %{_sysconfdir}/%{component}/neutron.conf
%config %{_sysconfdir}/%{component}/rootwrap.conf
%dir %{_sysconfdir}/%{component}/rootwrap.d/
%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/lib/%{component}
%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/log/%{component}
%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/cache/%{component}
%if 0%{?using_systemd}
%_tmpfilesdir/%name.conf
%else
%dir %attr(0700, %{username}, %{groupname}) %{_rundir}/%{component}
%endif
%dir %{_sysconfdir}/%{component}/plugins
%dir %{_sysconfdir}/%{component}/plugins/ml2/
%config(noreplace) %{_sysconfdir}/%{component}/plugins/ml2/linuxbridge_agent.ini
%config(noreplace) %{_sysconfdir}/%{component}/plugins/ml2/ml2_conf.ini
%config(noreplace) %{_sysconfdir}/%{component}/plugins/ml2/ml2_conf_sriov.ini
%config(noreplace) %{_sysconfdir}/%{component}/plugins/ml2/openvswitch_agent.ini
%config(noreplace) %{_sysconfdir}/%{component}/plugins/ml2/sriov_agent.ini
%config %{_sysconfdir}/%{component}/rootwrap.d/iptables-firewall.filters
%config %{_sysconfdir}/%{component}/rootwrap.d/ipset-firewall.filters
%config %{_sysconfdir}/%{component}/rootwrap.d/ebtables.filters
%{_bindir}/%{component}-debug
%{_bindir}/%{component}-keepalived-state-change
%{_bindir}/%{component}-netns-cleanup
%{_bindir}/%{component}-ipset-cleanup
%{_bindir}/%{component}-ns-metadata-proxy
%{_bindir}/%{component}-rootwrap
%{_bindir}/%{component}-rootwrap-daemon
%{_bindir}/%{component}-rootwrap-xen-dom0
%{_bindir}/%{component}-sanity-check
%{_bindir}/%{component}-sriov-nic-agent
%{_bindir}/%{component}-usage-audit
%{_mandir}/man1/%{component}.1%{?ext_man}
/var/adm/fillup-templates/sysconfig.neutron

%files dhcp-agent
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/%{component}-dhcp-agent
%{_initddir}/openstack-%{component}-dhcp-agent
%{_sbindir}/rcopenstack-%{component}-dhcp-agent
%config(noreplace) %{_sysconfdir}/%{component}/dhcp_agent.ini
%config %{_sysconfdir}/%{component}/rootwrap.d/dhcp.filters

%files l3-agent
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/%{component}-l3-agent
%{_bindir}/%{component}-pd-notify
%config %{_sysconfdir}/%{component}/rootwrap.d/l3.filters
%config(noreplace) %{_sysconfdir}/%{component}/l3_agent.ini
%{_initddir}/openstack-%{component}-l3-agent
%{_sbindir}/rcopenstack-%{component}-l3-agent

%files metadata-agent
%defattr(-,root,root,-)
%doc LICENSE
%config(noreplace) %{_sysconfdir}/%{component}/metadata_agent.ini
%{_bindir}/%{component}-metadata-agent
%{_initddir}/openstack-%{component}-metadata-agent
%{_sbindir}/rcopenstack-%{component}-metadata-agent

%files metering-agent
%defattr(-,root,root,-)
%doc LICENSE
%config(noreplace) %{_sysconfdir}/%{component}/metering_agent.ini
%{_bindir}/%{component}-metering-agent
%{_initddir}/openstack-%{component}-metering-agent
%{_sbindir}/rcopenstack-%{component}-metering-agent

#%files mlnx-agent
#%defattr(-,root,root,-)
#%doc LICENSE
#%dir %{_sysconfdir}/%{component}/plugins/mlnx
#%config(noreplace) %{_sysconfdir}/%{component}/plugins/mlnx/mlnx_conf.ini
#%{_bindir}/%{component}-mlnx-agent
#%{_initddir}/openstack-%{component}-mlnx-agent
#%{_sbindir}/rcopenstack-%{component}-mlnx-agent

#files ofagent-agent
#defattr(-,root,root,-)
#doc LICENSE
#{_bindir}/%{component}-ofagent-agent
#config %{_sysconfdir}/%{component}/rootwrap.d/ofagent.filters

%files linuxbridge-agent
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/%{component}-linuxbridge-agent
%{_bindir}/%{component}-linuxbridge-cleanup
%config %{_sysconfdir}/%{component}/rootwrap.d/linuxbridge-plugin.filters
%dir %{_sysconfdir}/%{component}/plugins/ml2/
%{_initddir}/openstack-%{component}-linuxbridge-agent
%{_sbindir}/rcopenstack-%{component}-linuxbridge-agent

%files openvswitch-agent
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_sysconfdir}/%{component}/plugins/ml2/
%{_bindir}/%{component}-openvswitch-agent
%{_bindir}/%{component}-ovs-cleanup
%{_initddir}/openstack-%{component}-ovs-cleanup
%{_sbindir}/rcopenstack-%{component}-ovs-cleanup
%config %{_sysconfdir}/%{component}/rootwrap.d/openvswitch-plugin.filters
%{_initddir}/openstack-%{component}-openvswitch-agent
%{_sbindir}/rcopenstack-%{component}-openvswitch-agent

%files macvtap-agent
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_sysconfdir}/%{component}/plugins/ml2/
%config(noreplace) %{_sysconfdir}/%{component}/plugins/ml2/macvtap_agent.ini
%{_bindir}/%{component}-macvtap-agent
%{_initddir}/openstack-%{component}-macvtap-agent
%{_sbindir}/rcopenstack-%{component}-macvtap-agent

%files bgp-dragent
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_sysconfdir}/%{component}/
%config(noreplace) %{_sysconfdir}/%{component}/bgp_dragent.ini
%{_bindir}/%{component}-bgp-dragent
%{_initddir}/openstack-%{component}-bgp-dragent
%{_sbindir}/rcopenstack-%{component}-bgp-dragent

%files server
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/%{component}-server
%{_bindir}/%{component}-rpc-server
%{_bindir}/%{component}-db-manage
%{_initddir}/openstack-%{component}
%{_sbindir}/rcopenstack-%{component}

%files -n python-neutron
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/%{component}-*.egg-info
# Part of test subpackage
%exclude %{python_sitelib}/%{component}/tests/

%files test
%defattr(-,root,root)
%{python_sitelib}/%{component}/tests/
%{_localstatedir}/lib/%{name}-test/
%config %{_sysconfdir}/%{component}/rootwrap.d/debug.filters

%files ha-tool
%defattr(-,root,root,-)
%{_bindir}/neutron-ha-tool

%changelog