Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue with NF_PORT_BYPASS #27

Merged
merged 2 commits into from
Jul 27, 2023
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.8] - 2023-07-27

### Fixed

- NF_PORT_BYPASS need to be an integer for check to work.
## [1.0.7] - 2023-07-26

### Changed
Expand Down
9 changes: 7 additions & 2 deletions router_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ def check_port(ip_host, port, timeout):
:return True if the host is reachable on the specified port, False otherwise.
"""
bypass = os.environ.get('NF_PORT_BYPASS')
logging.debug("Bypass value: %s", bypass)
if bypass:
bypass = int(os.environ.get('NF_PORT_BYPASS'))
else:
bypass = 0
if bypass == port:
logging.debug("Bypassing port check for port: %s", bypass)
logging.info("Bypassing port check for port: %s", bypass)
return True
socket_connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_connection.settimeout(timeout)
Expand Down Expand Up @@ -235,7 +240,7 @@ def create_parser():

:return: A Namespace containing arguments
"""
__version__ = '1.0.7'
__version__ = '1.0.8'
parser = argparse.ArgumentParser()

parser.add_argument('registration_key',
Expand Down
Loading