.settings/
__pycache__/
.idea
+
+deb_dist
+*.tar.gz
+*.db
\ No newline at end of file
FROM ubuntu:16.04
RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get --yes install git tox make python python-pip python3 python3-pip debhelper && \
- DEBIAN_FRONTEND=noninteractive apt-get --yes install wget python-dev python-software-properties python-stdeb && \
- DEBIAN_FRONTEND=noninteractive apt-get --yes install default-jre libmysqlclient-dev && \
- DEBIAN_FRONTEND=noninteractive apt-get --yes install libmysqlclient-dev libxml2 python3-all
+ DEBIAN_FRONTEND=noninteractive apt-get --yes install git tox make python-all python3 python3-pip debhelper wget && \
+ DEBIAN_FRONTEND=noninteractive apt-get --yes install libmysqlclient-dev libxml2 python3-all && \
+ DEBIAN_FRONTEND=noninteractive pip3 install -U setuptools setuptools-version-command stdeb
+
include test-requirements.txt
include README.rst
recursive-include osm_policy_module *.py *.xml *.sh
-recursive-include devops-stages *
-recursive-include test *.py
+recursive-include devops-stages *
\ No newline at end of file
--- /dev/null
+all: clean package
+
+clean:
+ rm -rf dist deb_dist osm_policy_module-*.tar.gz osm_policy_module.egg-info .eggs
+
+package:
+ python3 setup.py --command-packages=stdeb.command sdist_dsc
+ cp debian/python3-osm-policy-module.postinst deb_dist/osm-policy-module*/debian
+ cd deb_dist/osm-policy-module*/ && dpkg-buildpackage -rfakeroot -uc -us
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+echo "Installing python dependencies via pip..."
+pip3 install kafka==1.3.*
+pip3 install peewee==3.1.*
+pip3 install jsonschema==2.6.*
+pip3 install six==1.11.*
+pip3 install pyyaml==3.*
+echo "Installation of python dependencies finished"
\ No newline at end of file
#__date__ = "14/Sep/2017"
#!/bin/bash
-rm -rf deb_dist
-rm -rf dist
-rm -rf osm_mon.egg-info
-tox -e build
+make
cfg.OSMPOL_MESSAGE_PORT)
def run(self):
- cfg = Config.instance()
- cfg.read_environ()
-
consumer = KafkaConsumer(bootstrap_servers=self.kafka_server,
key_deserializer=bytes.decode,
value_deserializer=bytes.decode,
- consumer_timeout_ms=10000)
+ group_id='pol-consumer')
consumer.subscribe(["ns", "alarm_response"])
for message in consumer:
--- /dev/null
+[DEFAULT]
+X-Python3-Version : >= 3.4
+Depends3 : libmysqlclient-dev, python3-pip, python3-osm-common
\ No newline at end of file
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
-envlist = py3
+envlist = py3, flake8
toxworkdir={homedir}/.tox
[testenv]
commands =
flake8 osm_policy_module
-[testenv:build]
-basepython = python3
-deps = stdeb
- setuptools-version-command
-commands = python3 setup.py --command-packages=stdeb.command bdist_deb
-
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
max-line-length = 120
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,devops_stages/*,.rst
-
+[testenv:build]
+basepython = python3
+deps = stdeb
+ setuptools-version-command
+commands = python3 setup.py --command-packages=stdeb.command bdist_deb