Skip to content

Commit eb65054

Browse files
RubuschEmantor
authored andcommitted
client: make error a bit more helpful
If a Place has multiple SSH targets, typing "labgrid-client ssh <net-name>" triggers an ambiguous "multiple targets" error. It's usually just a missing -n flag, so let's point the user in the right direction with a clearer hint in the logs. Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
1 parent 3912486 commit eb65054

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

labgrid/remote/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,10 @@ def _get_ssh(self):
13081308
return drv
13091309

13101310
def ssh(self):
1311+
if self.args.leftover and not self.args.name:
1312+
potential_name = self.args.leftover[0]
1313+
print(f"Unknown argument '{potential_name}', did you miss a '-n'?")
1314+
13111315
drv = self._get_ssh()
13121316

13131317
res = drv.interact(self.args.leftover)

0 commit comments

Comments
 (0)