From 78e738144244fc1808c7efaf5d4d689800f36879 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 2 Nov 2018 15:18:55 -0400 Subject: [PATCH] Add implicit rescan on unmatched csv data If the csv file contains criteria we can't match, implicitly try a rescan automatically to try to catch it. --- confluent_client/bin/nodediscover | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/confluent_client/bin/nodediscover b/confluent_client/bin/nodediscover index dc09d63b..6288b7ed 100755 --- a/confluent_client/bin/nodediscover +++ b/confluent_client/bin/nodediscover @@ -19,6 +19,7 @@ import csv import optparse import os import sys +import time path = os.path.dirname(os.path.realpath(__file__)) path = os.path.realpath(os.path.join(path, '..', 'lib', 'python')) @@ -149,6 +150,10 @@ def import_csv(options, session): nodedatum[currfield] = datum if not datum_complete(nodedatum): sys.exit(1) + if not search_record(nodedatum, options, session): + list(session.update('/discovery/rescan', + {'rescan': 'start'})) + time.sleep(5) if not search_record(nodedatum, options, session): sys.stderr.write( "Could not match the following data: " +