Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Misc fixes #91

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .travis-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ RUN yum -y update && \
gcc-c++ \
krb5-devel \
libffi-devel \
libyaml-devel \
# libyaml-devel \
openssl-devel \
python27 \
python-devel \
python-pip \
python3 \
python3-devel \
python3-pip \
redhat-rpm-config \
swig \
zeromq-devel \
rpm-devel \
python2-koji \
python3-koji \
libmodulemd && \
yum clean all

COPY . .

RUN pip install --upgrade pip setuptools && \
python setup.py develop && pip install -r test-requirements.txt
RUN pip3 install --upgrade pip setuptools && \
python3 setup.py develop && \
pip3 install -r test-requirements.txt

CMD ["pytest", "-v", "pdcupdater/tests/"]
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ Try running the test suite::

$ dnf install libyaml-devel
$ pip install -r test-requirements.txt
$ nosetests
$ pytest

Check test suite coverage::

$ pip install coverage
$ nosetests --with-coverage --cover-package=pdcupdater
$ pytest --with-coverage --cov=pdcupdater

If the test suite is failing, one thing to try is to remove the VCR cassette
data before re-running the tests::

$ rm -rf pdcupdater/tests/vcr-request-data/
$ nosetests
$ pytest

Getting an authentication token
-------------------------------
Expand Down
26 changes: 13 additions & 13 deletions fedmsg.d/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,38 @@
#
# Authors: Ralph Bean <[email protected]>
#
config = dict(
config = {
# Set this to dev if you're hacking on fedmsg or an app.
# Set to stg or prod if running in the Fedora Infrastructure
environment="dev",
'environment': "dev",

# Default is 0
high_water_mark=0,
io_threads=1,
'high_water_mark': 0,
'io_threads': 1,

## For the fedmsg-hub and fedmsg-relay. ##

# We almost always want the fedmsg-hub to be sending messages with zmq as
# opposed to amqp or stomp.
zmq_enabled=True,
'zmq_enabled': True,

# When subscribing to messages, we want to allow splats ('*') so we tell
# the hub to not be strict when comparing messages topics to subscription
# topics.
zmq_strict=False,
'zmq_strict': False,

# Number of seconds to sleep after initializing waiting for sockets to sync
post_init_sleep=0.5,
'post_init_sleep': 0.5,

# Wait a whole second to kill all the last io threads for messages to
# exit our outgoing queue (if we have any). This is in milliseconds.
zmq_linger=1000,
'zmq_linger': 1000,

# See the following
# - http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html
# - http://api.zeromq.org/3-2:zmq-setsockopt
zmq_tcp_keepalive=1,
zmq_tcp_keepalive_cnt=3,
zmq_tcp_keepalive_idle=60,
zmq_tcp_keepalive_intvl=5,
)
'zmq_tcp_keepalive': 1,
'zmq_tcp_keepalive_cnt': 3,
'zmq_tcp_keepalive_idle': 60,
'zmq_tcp_keepalive_intvl': 5,
}
36 changes: 18 additions & 18 deletions fedmsg.d/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@
# See the following for constraints on this format http://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"

config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
config = {
'logging': {
'version': 1,
'formatters': {
'bare': {
"datefmt": "%Y-%m-%d %H:%M:%S",
"format": bare_format
},
),
handlers=dict(
console={
},
'handlers': {
'console': {
"class": "logging.StreamHandler",
"formatter": "bare",
"level": "DEBUG",
"stream": "ext://sys.stdout",
}
),
loggers=dict(
fedmsg={
},
'loggers': {
'fedmsg': {
"level": "DEBUG",
"propagate": False,
"handlers": ["console"],
},
moksha={
'moksha': {
"level": "DEBUG",
"propagate": False,
"handlers": ["console"],
},
pkgdb2client={
'pkgdb2client': {
"level": "INFO",
"propagate": False,
"handlers": ["console"],
},
modules={
'modules': {
"level": "DEBUG",
"propagate": False,
"handlers": ["console"],
},
pdcupdater={
'pdcupdater': {
"level": "DEBUG",
"propagate": False,
"handlers": ["console"],
},
),
),
)
},
},
}
10 changes: 5 additions & 5 deletions fedmsg.d/pdcupdater-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
'pdcupdater.ContainerRPMInclusionDepChainHandler.container_build_user': 'containerbuild',

# Augment the base fedmsg logging config to also handle pdcupdater loggers.
'logging': dict(
loggers=dict(
pdcupdater={
'logging': {
'loggers': {
'pdcupdater': {
"level": "DEBUG",
"propagate": False,
"handlers": ["console"],
},
)
)
},
},
}
33 changes: 16 additions & 17 deletions fedmsg.d/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,28 @@
# Authors: Ralph Bean <[email protected]>
#
import os
import socket

SEP = os.path.sep
here = os.getcwd()

config = dict(
sign_messages=False,
validate_signatures=False,
config = {
'sign_messages': False,
'validate_signatures': False,

# Use these implementations to sign and validate messages
crypto_backend='x509',
crypto_validate_backends=['x509'],
'crypto_backend': 'x509',
'crypto_validate_backends': ['x509'],

ssldir="/etc/pki/fedmsg",
crl_location="https://fedoraproject.org/fedmsg/crl.pem",
crl_cache="/var/run/fedmsg/crl.pem",
crl_cache_expiry=10,
'ssldir': "/etc/pki/fedmsg",
'crl_location': "https://fedoraproject.org/fedmsg/crl.pem",
'crl_cache': "/var/run/fedmsg/crl.pem",
'crl_cache_expiry': 10,

ca_cert_location="https://fedoraproject.org/fedmsg/ca.crt",
ca_cert_cache="/var/run/fedmsg/ca.crt",
ca_cert_cache_expiry=0, # Never expires
'ca_cert_location': "https://fedoraproject.org/fedmsg/ca.crt",
'ca_cert_cache': "/var/run/fedmsg/ca.crt",
'ca_cert_cache_expiry': 0, # Never expires

certnames={
'certnames': {
# In prod/stg, map hostname to the name of the cert in ssldir.
# Unfortunately, we can't use socket.getfqdn()
#"app01.stg": "app01.stg.phx2.fedoraproject.org",
Expand All @@ -49,7 +48,7 @@
# A mapping of fully qualified topics to a list of cert names for which
# a valid signature is to be considered authorized. Messages on topics not
# listed here are considered automatically authorized.
routing_policy={
'routing_policy': {
# Only allow announcements from production if they're signed by a
# certain certificate.
"org.fedoraproject.prod.announce.announcement": [
Expand All @@ -62,5 +61,5 @@
# When this is False, only messages that have a topic in the routing_policy
# but whose cert names aren't in the associated list are dropped; messages
# whose topics do not appear in the routing_policy are not dropped.
routing_nitpicky=False,
)
'routing_nitpicky': False,
}
Loading