Skip to content

Commit

Permalink
Merge pull request #27 from netfoundry/bugfix/fix_nf_port_bypass
Browse files Browse the repository at this point in the history
fixed issue with NF_PORT_BYPASS
  • Loading branch information
emoscardini authored Jul 27, 2023
2 parents 9aaa683 + eb62c25 commit 5a5bdba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit 5a5bdba

Please sign in to comment.