Skip to content

Commit acc55aa

Browse files
committed
If we are accessing a remote machine we must have a username/password. Flag that to users.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
1 parent 3b901a4 commit acc55aa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

hwinfo/tools/inspector.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import paramiko
66
import subprocess
77
import os
8+
import sys
89

910
from hwinfo.pci import PCIDevice
1011
from hwinfo.pci.lspci import *
@@ -184,6 +185,11 @@ def main():
184185
if args.logs:
185186
host = HostFromLogs(args.logs)
186187
else:
188+
if args.machine:
189+
if not args.username or not args.password:
190+
print "Error: you must specify a username and password to query a remote machine."
191+
sys.exit(1)
192+
187193
host = Host(args.machine, args.username, args.password)
188194

189195
options = []

0 commit comments

Comments
 (0)