Restore ELK5.x configuration on ELK6.x
Issue-ID: CLAMP-226
Change-Id: Ibc45fb78aae271d275c89c8a6723fa9f0a95fcb0
Signed-off-by: ac2550 <ac2550@intl.att.com>
diff --git a/src/main/docker/kibana/restore.py b/src/main/docker/kibana/restore.py
index f58701b..70f430c 100755
--- a/src/main/docker/kibana/restore.py
+++ b/src/main/docker/kibana/restore.py
@@ -90,7 +90,10 @@
obj_id = obj['id']
for key in ('id', 'version', 'type', 'updated_at'):
- del obj[key]
+ try:
+ del obj[key]
+ except KeyError:
+ logger.info("Could not find key %s in %s[%s]", key, obj_type, obj_id)
logger.info('Restoring %s id:%s (overwrite:%s)', obj_type, obj_id, args.force)
url = "%s/api/saved_objects/%s/%s" % (args.kibana_host.rstrip("/"), obj_type, obj_id)