Skip to content

Commit

Permalink
Merge pull request #60 from netfoundry/feature/add_skip_software_mana…
Browse files Browse the repository at this point in the history
…gement_port_check

add skipSoftwareMgmtPortCheck flag
  • Loading branch information
emoscardini authored Sep 25, 2024
2 parents 1567aee + dc4a2a0 commit cdd6fdb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Changelog

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.6.3] - 2024-09-25

- Add --skipSoftwareMgmtPortCheck to allow skipping just the software management port check.

## [1.6.2] - 2024-09-18

### Added

- Add --skip-checks flag to allow skipping controller checks(port/certificate)
- Add --skipChecks flag to allow skipping controller checks(port/certificate)


## [1.6.1] - 2024-08-15
Expand Down
16 changes: 12 additions & 4 deletions router_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from colorama import Fore, Style, init
import ziti_router_auto_enroll

def check_controller(controller_host):
def check_controller(controller_host, skip_software_mgmt_port):
"""
Check controller for open ports & certificate. If anything doesn't work exit.
Expand All @@ -38,7 +38,11 @@ def check_controller(controller_host):
check_controller_certificate(controller_host)

# check controller for ports
port_list = [443, 6262]
if skip_software_mgmt_port:
logging.info("Skipping Software Management Port checks")
port_list = [443]
else:
port_list = [443, 6262]
for port in port_list:
if not check_host_port(controller_host, port):
logging.error("Unable to communicate with "
Expand Down Expand Up @@ -302,7 +306,7 @@ def create_parser():
:return: A Namespace containing arguments
"""
__version__ = '1.6.2'
__version__ = '1.6.3'
parser = argparse.ArgumentParser()

mgroup = parser.add_mutually_exclusive_group(required=True)
Expand Down Expand Up @@ -335,6 +339,10 @@ def create_parser():
action='store_true',
default=False,
help='Skip all controller checks - port/certificate')
parser.add_argument('--skipSoftwareMgmtPortCheck',
action='store_true',
default=False,
help='Skip the Software Management Port Check')
parser.add_argument('--haEnabled',
action='store_true',
help='Specify haEnabled flag in configuration',
Expand Down Expand Up @@ -1050,7 +1058,7 @@ def main():

# check controller communications
if do_checks:
check_controller(router_info['networkControllerHost'])
check_controller(router_info['networkControllerHost'], args.skipSoftwareMgmtPortCheck)

# handle ziti_router_auto_enroll
handle_ziti_router_auto_enroll(args, router_info, enrollment_commands, registration_endpoint)
Expand Down

0 comments on commit cdd6fdb

Please sign in to comment.