Skip to content
Snippets Groups Projects
Commit ae61b807 authored by Simon Janos's avatar Simon Janos
Browse files

fájl írással/olvasással kapcsolatos hibák kezelése

parent a2667b08
Branches
No related tags found
No related merge requests found
......@@ -13,7 +13,12 @@ args = parser.parse_args()
uri = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/MSFT_NetRoute"
try:
machines = csv.reader(open(args.machines, newline=''))
except FileNotFoundError:
print("Cannot open input file (" + args.machines + ")")
exit(1)
for row in machines:
wsman = ["wsman", "-h", row[0], "-u", row[2], "-p", row[3], "--auth", "basic", "--non-interactive", "enumerate", "-N", "root/standardcimv2", uri]
try:
......@@ -53,6 +58,8 @@ for row in machines:
except subprocess.CalledProcessError:
print("ERROR: could not connect to " + row[0])
except FileNotFoundError:
print("Cannot write output file, directory does not exist or not writable.")
#et = etree.XML(rt.encode('utf-8'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment