Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Added warning message to --no-firewall-rule #2142

Merged
merged 2 commits into from
Jun 5, 2019
Merged
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
11 changes: 10 additions & 1 deletion tools/cli/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
'`datalab` command line tool. Instances created in that network may '
'be open to traffic that they should not be exposed to.')

_DATALAB_NO_FIREWALL_WARNING = (
'\nWarning: --no-firewall-rule requires firewall rules to be '
'configured in advance. \n'
'Incorrect configuration may result in errors like: \n'
'ssh_exchange_identification: Connection closed by remote host \n\n'
)

_DATALAB_DEFAULT_DISK_SIZE_GB = 200
_DATALAB_DISK_DESCRIPTION = (
'Persistent disk for a Google Cloud Datalab instance')
Expand Down Expand Up @@ -951,7 +958,9 @@ def prepare(args, gcloud_compute, gcloud_repos):
"""
network_name = args.network_name
ensure_network_exists(args, gcloud_compute, network_name)
if not args.no_firewall_rule:
if args.no_firewall_rule:
print(_DATALAB_NO_FIREWALL_WARNING)
else:
prompt_on_unexpected_firewall_rules(args, gcloud_compute, network_name)
ensure_firewall_rule_exists(args, gcloud_compute, network_name)

Expand Down