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

Commit d6ddeac

Browse files
mdhedleyrileyjbauer
authored andcommitted
Added warning message to --no-firewall-rule (#2142)
* Added warning message to highlight requirement to configure firewall rules when using --no-firewall-rule * Remove extra space
1 parent 77b8b54 commit d6ddeac

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/cli/commands/create.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@
5353
'`datalab` command line tool. Instances created in that network may '
5454
'be open to traffic that they should not be exposed to.')
5555

56+
_DATALAB_NO_FIREWALL_WARNING = (
57+
'\nWarning: --no-firewall-rule requires firewall rules to be '
58+
'configured in advance. \n'
59+
'Incorrect configuration may result in errors like: \n'
60+
'ssh_exchange_identification: Connection closed by remote host \n\n'
61+
)
62+
5663
_DATALAB_DEFAULT_DISK_SIZE_GB = 200
5764
_DATALAB_DISK_DESCRIPTION = (
5865
'Persistent disk for a Google Cloud Datalab instance')
@@ -951,7 +958,9 @@ def prepare(args, gcloud_compute, gcloud_repos):
951958
"""
952959
network_name = args.network_name
953960
ensure_network_exists(args, gcloud_compute, network_name)
954-
if not args.no_firewall_rule:
961+
if args.no_firewall_rule:
962+
print(_DATALAB_NO_FIREWALL_WARNING)
963+
else:
955964
prompt_on_unexpected_firewall_rules(args, gcloud_compute, network_name)
956965
ensure_firewall_rule_exists(args, gcloud_compute, network_name)
957966

0 commit comments

Comments
 (0)