Skip to content

Commit 726d644

Browse files
ohitspaulCptTZ
authored andcommitted
Update error message; replace deprecated method
1 parent bc9c3a1 commit 726d644

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ec2instanceconnectcli/input_parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ def _validate_custom_flags(flags):
8686
for flag in flags:
8787
flag = flag.strip()
8888
if flag == '-i':
89-
raise AssertionError("Should not use '-i' switch as we will handle identity file")
89+
raise AssertionError(
90+
"'-i' is not supported when using mssh. When using the mssh command to connect to your instance, you "
91+
"do not need to specify any kind of identity file, because EC2 Instance Connect manages the key pair. "
92+
"Remove the -i flag from 'mssh <instance-id>' (or 'mssh <user>@<instance-id>' for an Ubuntu instance) "
93+
"and try again."
94+
)
9095

9196
def _validate_instance_bundles(instance_bundles, mode):
9297
"""

tests/test_EC2ConnectCLI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ def test_status_code(self):
184184
#TODO: Refine test for checking run_command status code
185185
cli = EC2InstanceConnectCLI(None, None, None, None)
186186
code = cli.run_command("echo ok; exit -1;")
187-
self.assertEquals(code, 255)
187+
self.assertEqual(code, 255)

0 commit comments

Comments
 (0)