netfilter - Python 3.8 - SyntaxWarning for 'is not' (#3537)

master
Christian Burmeister 2020-05-12 18:26:03 +02:00 committed by GitHub
parent f11324d32b
commit b5502fb52a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -496,7 +496,7 @@ if __name__ == '__main__':
watch_thread.daemon = True watch_thread.daemon = True
watch_thread.start() watch_thread.start()
if os.getenv('SNAT_TO_SOURCE') and os.getenv('SNAT_TO_SOURCE') is not 'n': if os.getenv('SNAT_TO_SOURCE') and os.getenv('SNAT_TO_SOURCE') != 'n':
try: try:
snat_ip = os.getenv('SNAT_TO_SOURCE') snat_ip = os.getenv('SNAT_TO_SOURCE')
snat_ipo = ipaddress.ip_address(snat_ip) snat_ipo = ipaddress.ip_address(snat_ip)
@ -507,7 +507,7 @@ if __name__ == '__main__':
except ValueError: except ValueError:
print(os.getenv('SNAT_TO_SOURCE') + ' is not a valid IPv4 address') print(os.getenv('SNAT_TO_SOURCE') + ' is not a valid IPv4 address')
if os.getenv('SNAT6_TO_SOURCE') and os.getenv('SNAT6_TO_SOURCE') is not 'n': if os.getenv('SNAT6_TO_SOURCE') and os.getenv('SNAT6_TO_SOURCE') != 'n':
try: try:
snat_ip = os.getenv('SNAT6_TO_SOURCE') snat_ip = os.getenv('SNAT6_TO_SOURCE')
snat_ipo = ipaddress.ip_address(snat_ip) snat_ipo = ipaddress.ip_address(snat_ip)