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

🐛 Raise SystemExit when port-forwarding is enabled and local port is not available #48

Merged
merged 2 commits into from
Nov 5, 2020
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- 🐛 Raise SystemExit when port-forwarding is enabled and local port is not available. PR [#48](https://github.com/NCAR/jupyter-forward/pull/48) by [@andersy005](https://github.com/andersy005)

## v2020.10.27

- ⚡ Use try block to exit gracefully. PR [#45](https://github.com/NCAR/jupyter-forward/pull/45) by [@andersy005](https://github.com/andersy005)
Expand Down
2 changes: 1 addition & 1 deletion jupyter_forward/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RemoteRunner:
shell: str = '/usr/bin/env bash'

def __post_init__(self):
if not is_port_available(self.port):
if self.port_forwarding and not is_port_available(self.port):
raise SystemExit(
(
f'''Specified port={self.port} is already in use on your local machine. Try a different port'''
Expand Down