We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f076fb commit ea87603Copy full SHA for ea87603
examples/restore_dashboards.py
@@ -39,12 +39,18 @@
39
40
for info in zipf.infolist():
41
data = zipf.read(info.filename)
42
- j = json.loads(data)
+ try:
43
+ j = json.loads(data)
44
+ except ValueError:
45
+ print 'Non-JSON item found in ZIP: ' + info.filename + ' (skipping)'
46
+ continue
47
k = {}
48
for item in j.keys():
49
if item in dashboard_conf_items:
50
k[item] = j[item]
51
52
res = sdclient.create_dashboard_with_configuration(k)
- if res[0] == False:
53
+ if res[0]:
54
+ print 'Restored Dashboard named: ' + j['name']
55
+ else:
56
print "Dashboard creation failed for dashboard name %s with error %s" % (j['name'], res[1])
0 commit comments