mirror of https://github.com/fail2ban/fail2ban
				
				
				
			Added helper scripts to carry out 2to3 and testcases on python3
							parent
							
								
									c8c9ed4dfc
								
							
						
					
					
						commit
						dbc40d6210
					
				| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
# This script carries out conversion of fail2ban to python3
 | 
			
		||||
# A backup of any converted files are created with ".bak"
 | 
			
		||||
# extension
 | 
			
		||||
 | 
			
		||||
set -eu
 | 
			
		||||
 | 
			
		||||
nonPyFiles="fail2ban-client fail2ban-server fail2ban-regex fail2ban-testcases"
 | 
			
		||||
 | 
			
		||||
find . \
 | 
			
		||||
    -name "*.py" \
 | 
			
		||||
    -exec 2to3 -w --no-diffs $nonPyFiles {} + \
 | 
			
		||||
    || echo "Fail!" >&2 && exit 1
 | 
			
		||||
 | 
			
		||||
echo "Success!" >&2
 | 
			
		||||
 | 
			
		||||
exit 0
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
# Simple helper script to exercise unittests using all available
 | 
			
		||||
# (under /usr/bin and /usr/local/bin python2.*)
 | 
			
		||||
 | 
			
		||||
set -eu
 | 
			
		||||
 | 
			
		||||
failed=
 | 
			
		||||
for python in /usr/{,local/}bin/python3.[0-9]{,.*}{,-dbg}
 | 
			
		||||
do
 | 
			
		||||
	[ -e "$python" ] || continue
 | 
			
		||||
	echo "Testing using $python"
 | 
			
		||||
	$python ./fail2ban-testcases "$@" || failed+=" $python"
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
if [ ! -z "$failed" ]; then
 | 
			
		||||
	echo "E: Failed with $failed"
 | 
			
		||||
	exit 1
 | 
			
		||||
fi
 | 
			
		||||
		Loading…
	
		Reference in New Issue