Skip to content

Commit 3d28ec4

Browse files
committed
Merge branch 'release-2.1.5'
2 parents e57775e + dd10727 commit 3d28ec4

File tree

13 files changed

+304
-172
lines changed

13 files changed

+304
-172
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ install:
1616
- pip install python-ldap
1717
- pip install dirq
1818
- pip install unittest2
19+
- pip install coveralls
1920

2021
before_script:
2122
- export TMPDIR=$PWD/tmp
@@ -24,6 +25,7 @@ before_script:
2425
script:
2526
- export PYTHONPATH=$PYTHONPATH:`pwd -P`
2627
- cd test
27-
#- unit2 -b discover
28-
# Don't run test_crypto until it's fixed
29-
- unit2 -b test_brokers test_ssm
28+
- coverage run --source=ssm,bin -m unittest2 discover --buffer
29+
30+
after_success:
31+
- coveralls

CHANGELOG

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
Changelog for ssm
22
=================
3+
* Fri Nov 28 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-1
4+
- (No changes from pre-release version.)
5+
6+
* Fri Nov 28 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.4.rc4
7+
- Corrected namespace of overridden variable (to enable SSL/TLS changes).
8+
9+
* Fri Nov 28 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.3.rc3
10+
- Removed python-ssl as a dependency as it can be option in some contexts.
11+
- Made it possible for old versions of stomp.py (3.0.3 and lower) to use
12+
SSL/TLS versions that aren't SSL 3.0.
13+
14+
* Thu Nov 27 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.2.rc2
15+
- Added a warning for old versions of stomp.py (3.0.3 and lower) that are
16+
limited to using SSL 3.0 for secure connections.
17+
18+
* Tue Nov 25 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.1.rc1
19+
- The highest version of SSL/TLS available is now used (previously only SSLv3).
20+
- Added python-ssl as a dependency (SL5/EL5 only).
21+
- Minor tweaks made to logging calls and the logging level of certain messages.
22+
323
* Fri Aug 08 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.4-1
424
- Corrected version number used in Python code.
525

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Secure Stomp Messenger
22

33
[![Build Status](https://travis-ci.org/apel/ssm.svg?branch=dev)](https://travis-ci.org/apel/ssm)
4+
[![Coverage Status](https://coveralls.io/repos/apel/ssm/badge.png?branch=dev)](https://coveralls.io/r/apel/ssm?branch=dev)
5+
[![Code Health](https://landscape.io/github/apel/ssm/dev/landscape.png)](https://landscape.io/github/apel/ssm/dev)
46

57
Secure Stomp Messenger (SSM) is designed to simply send messages
68
using the STOMP protocol. Messages are signed and may be encrypted
@@ -20,7 +22,7 @@ The EPEL repository must be enabled. This can be done by installing
2022
the RPM for your version of SL, which is available on this page:
2123
http://fedoraproject.org/wiki/EPEL
2224

23-
The python stomp library
25+
The python stomp library (N.B. version 4 is currently not supported)
2426
* `yum install stomppy`
2527

2628
The python daemon library

apel-ssm.spec

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%endif
55

66
Name: apel-ssm
7-
Version: 2.1.4
7+
Version: 2.1.5
88
%define releasenumber 1
99
Release: %{releasenumber}%{?dist}
1010
Summary: Secure stomp messenger
@@ -92,6 +92,26 @@ rm -rf $RPM_BUILD_ROOT
9292
%doc %_defaultdocdir/%{name}
9393

9494
%changelog
95+
* Fri Nov 28 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-1
96+
- (No changes from pre-release version.)
97+
98+
* Fri Nov 28 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.4.rc4
99+
- Corrected namespace of overridden variable (to enable SSL/TLS changes).
100+
101+
* Fri Nov 28 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.3.rc3
102+
- Removed python-ssl as a dependency as it can be option in some contexts.
103+
- Made it possible for old versions of stomp.py (3.0.3 and lower) to use
104+
SSL/TLS versions that aren't SSL 3.0.
105+
106+
* Thu Nov 27 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.2.rc2
107+
- Added a warning for old versions of stomp.py (3.0.3 and lower) that are
108+
limited to using SSL 3.0 for secure connections.
109+
110+
* Tue Nov 25 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.5-0.1.rc1
111+
- The highest version of SSL/TLS available is now used (previously only SSLv3).
112+
- Added python-ssl as a dependency (SL5/EL5 only).
113+
- Minor tweaks made to logging calls and the logging level of certain messages.
114+
95115
* Fri Aug 08 2014 Adrian Coveney <adrian.coveney@stfc.ac.uk> - 2.1.4-1
96116
- Corrected version number used in Python code.
97117

bin/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file exists so that the tests can import modules from the bin directory

bin/receiver.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ def get_dns(dn_file):
5353
elif line.strip().startswith('/'):
5454
dns.append(line.strip())
5555
else:
56-
log.warn('DN in incorrect format: %s' % line)
56+
log.warn('DN in incorrect format: %s', line)
5757
finally:
5858
if f is not None:
5959
f.close()
6060
# If no valid DNs, SSM cannot receive any messages.
6161
if len(dns) == 0:
6262
raise Ssm2Exception('No valid DNs found in %s. SSM will not start' % dn_file)
63-
64-
log.debug('%s DNs found.' % len(dns))
63+
64+
log.debug('%s DNs found.', len(dns))
6565
return dns
6666

6767

@@ -108,8 +108,8 @@ def main():
108108
log = logging.getLogger('ssmreceive')
109109

110110
log.info(LOG_BREAK)
111-
log.info('Starting receiving SSM version %s.%s.%s.' % __version__)
112-
111+
log.info('Starting receiving SSM version %s.%s.%s.', *__version__)
112+
113113
# If we can't get a broker to connect to, we have to give up.
114114
try:
115115
bg = StompBrokerGetter(cp.get('broker','bdii'))
@@ -131,7 +131,7 @@ def main():
131131
log.info(LOG_BREAK)
132132
sys.exit(1)
133133
except ldap.SERVER_DOWN, e:
134-
log.error('Could not connect to LDAP server: %s' % e)
134+
log.error('Could not connect to LDAP server: %s', e)
135135
log.error('System will exit.')
136136
log.info(LOG_BREAK)
137137
sys.exit(1)
@@ -165,7 +165,7 @@ def main():
165165
ssm.set_dns(dns)
166166

167167
except Exception, e:
168-
log.fatal('Failed to initialise SSM: %s' % e)
168+
log.fatal('Failed to initialise SSM: %s', e)
169169
log.info(LOG_BREAK)
170170
sys.exit(1)
171171

@@ -206,7 +206,7 @@ def main():
206206
dc.close()
207207
except Exception, e:
208208
log.error('Unexpected exception: ' + str(e))
209-
log.error('Exception type: %s' % e.__class__)
209+
log.error('Exception type: %s', e.__class__)
210210
log.error('The SSM will exit.')
211211
ssm.shutdown()
212212
dc.close()

bin/sender.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@ def main():
6464
log = logging.getLogger('ssmsend')
6565

6666
log.info(LOG_BREAK)
67-
log.info('Starting sending SSM version %s.%s.%s.' % __version__)
67+
log.info('Starting sending SSM version %s.%s.%s.', *__version__)
6868
# If we can't get a broker to connect to, we have to give up.
6969
try:
7070
bdii_url = cp.get('broker','bdii')
71-
log.info('Retrieving broker details from %s ...' % bdii_url)
71+
log.info('Retrieving broker details from %s ...', bdii_url)
7272
bg = StompBrokerGetter(bdii_url)
7373
use_ssl = cp.getboolean('broker', 'use_ssl')
7474
if use_ssl:
7575
service = STOMP_SSL_SERVICE
7676
else:
7777
service = STOMP_SERVICE
7878
brokers = bg.get_broker_hosts_and_ports(service, cp.get('broker','network'))
79-
log.info('Found %s brokers.' % len(brokers))
79+
log.info('Found %s brokers.', len(brokers))
8080
except ConfigParser.NoOptionError, e:
8181
try:
8282
host = cp.get('broker', 'host')
@@ -90,7 +90,7 @@ def main():
9090
print 'SSM failed to start. See log file for details.'
9191
sys.exit(1)
9292
except ldap.LDAPError, e:
93-
log.error('Could not connect to LDAP server: %s' % e)
93+
log.error('Could not connect to LDAP server: %s', e)
9494
log.error('System will exit.')
9595
log.info(LOG_BREAK)
9696
print 'SSM failed to start. See log file for details.'
@@ -140,12 +140,12 @@ def main():
140140

141141
except (Ssm2Exception, CryptoException), e:
142142
print 'SSM failed to complete successfully. See log file for details.'
143-
log.error('SSM failed to complete successfully: %s' % e)
143+
log.error('SSM failed to complete successfully: %s', e)
144144
except Exception, e:
145145
print 'SSM failed to complete successfully. See log file for details.'
146-
log.error('Unexpected exception in SSM: %s' % (str(e)))
147-
log.error('Exception type: %s' % e.__class__)
148-
146+
log.error('Unexpected exception in SSM: %s', e)
147+
log.error('Exception type: %s', e.__class__)
148+
149149
try:
150150
sender.close_connection()
151151
except UnboundLocalError:

ssm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import logging
2020
import sys
2121

22-
__version__ = (2, 1, 4)
22+
__version__ = (2, 1, 5)
2323

2424
LOG_BREAK = '========================================'
2525

ssm/brokers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, bdii_url):
4141
Set up the LDAP connection and strings which are re-used.
4242
'''
4343
# Set up the LDAP connection
44-
log.debug('Connecting to %s...' % bdii_url)
44+
log.debug('Connecting to %s...', bdii_url)
4545
self._ldap_conn = ldap.initialize(bdii_url)
4646

4747
self._base_dn = 'o=grid'

ssm/crypto.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def check_cert_key(certpath, keypath):
5858
cert = _from_file(certpath)
5959
key = _from_file(keypath)
6060
except IOError, e:
61-
log.error('Could not find cert or key file: %s' % e)
61+
log.error('Could not find cert or key file: %s', e)
6262
return False
6363

6464
# Two things the same have the same modulus.
@@ -102,7 +102,7 @@ def sign(text, certpath, keypath):
102102
return signed_msg
103103

104104
except OSError, e:
105-
log.error('Failed to sign message: %s' % e)
105+
log.error('Failed to sign message: %s', e)
106106
raise CryptoException('Message signing failed. Check cert and key permissions.')
107107

108108

@@ -241,8 +241,8 @@ def verify_cert(certstring, capath, check_crls=True):
241241
# If it fails, openssl prints 'error'
242242
# So:
243243
log.info('Certificate verification: ' + str(message).strip())
244-
245-
return ('OK' in message and not 'error' in message)
244+
245+
return ('OK' in message and 'error' not in message)
246246

247247

248248
def verify_cert_path(certpath, capath, check_crls=True):

0 commit comments

Comments
 (0)