Skip to content

Commit

Permalink
setup.py missing universal truth in setup_req*.txt
Browse files Browse the repository at this point in the history
Issues:
Fixes F5Networks#958

Problem:
* `setup_requirements.txt` missing from `setup.py`

Analysis:
* This adds it and allows for pip library to exist for redhat and ubuntu
  * Both required for build Dockerfile's

Tests:
This is driven by the:
`./f5-openstack-agent-dist/scripts/test_install.sh`
Test script for building packages and validating them.
  • Loading branch information
sorensF5 committed Sep 25, 2017
1 parent 3e4d0e1 commit c0cb4bb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 21 deletions.
2 changes: 2 additions & 0 deletions f5-openstack-agent-dist/Docker/redhat/7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM centos:7

RUN yum update -y && yum install rpm-build make python-setuptools git -y
RUN curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
RUN python get-pip.py

COPY ./build-rpms.sh /
1 change: 1 addition & 0 deletions f5-openstack-agent-dist/Docker/ubuntu/14.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y \
python-stdeb \
fakeroot \
python-all \
python-pip \
git

COPY ./build-debs.sh /
Expand Down
54 changes: 33 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,48 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import f5_openstack_agent
import os
import pip
import setuptools

import f5_openstack_agent

cwd = os.getcwd()
try:
install_requirements = []
reqs_iter = \
pip.req.parse_requirements('setup_requirements.txt', session='setup')
install_requirements = map(lambda x: str(x.req), reqs_iter)
except pip.exceptions.InstallationError:
if '/tox/' not in cwd or '/.tox/' not in cwd or 'rpm' not in cwd:
raise

setuptools.setup(
version=f5_openstack_agent.__version__,
name="f5-openstack-agent",
description = ("F5 Networks Agent for OpenStack services"),
license = 'Apache License, Version 2.0',
description=("F5 Networks Agent for OpenStack services"),
license='Apache License, Version 2.0',
author="F5 Networks",
author_email="f5_openstack_agent@f5.com",
data_files=[('/etc/neutron/services/f5', ['etc/neutron/services/f5/f5-openstack-agent.ini']),
data_files=[('/etc/neutron/services/f5',
['etc/neutron/services/f5/f5-openstack-agent.ini']),
('/etc/init.d', ['etc/init.d/f5-oslbaasv2-agent']),
('/usr/lib/systemd/system', ['lib/systemd/system/f5-openstack-agent.service']),
('/usr/lib/systemd/system',
['lib/systemd/system/f5-openstack-agent.service']),
('/usr/bin/f5', ['bin/debug_bundler.py'])],
packages=setuptools.find_packages(exclude=['*.test', '*.test.*', 'test*', 'test']),
classifiers=[
'Environment :: OpenStack',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7'
],
packages=setuptools.find_packages(exclude=['*.test', '*.test.*', 'test*',
'test']),
classifiers='''Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7'''.split("\n"),
entry_points={
'console_scripts': [
'f5-oslbaasv2-agent = f5_openstack_agent.lbaasv2.drivers.bigip.agent:main'
]
},
install_requires=['f5-sdk==2.3.3']
str('f5-oslbaasv2-agent ='
'f5_openstack_agent.lbaasv2.drivers.bigip.agent:main')]},
install_requires=install_requirements
)

0 comments on commit c0cb4bb

Please sign in to comment.