CORD-2772 report version of core
prevent synchronizers from returning core version

Change-Id: I0ba8766d32baad08faec03add7054adc44eba11f
diff --git a/lib/xos-util/xosutil/autodiscover_version.py b/lib/xos-util/xosutil/autodiscover_version.py
index d41f4b3..2e606e1 100644
--- a/lib/xos-util/xosutil/autodiscover_version.py
+++ b/lib/xos-util/xosutil/autodiscover_version.py
@@ -24,7 +24,7 @@
 import inspect
 import os
 
-def autodiscover_version(caller_filename=None, save_to=None):
+def autodiscover_version(caller_filename=None, save_to=None, max_parent_depth=None):
     """ walk back along the path to the current module, searching for a VERSION file """
     if not caller_filename:
         caller_filename = os.path.realpath(__file__)
@@ -41,6 +41,12 @@
                 f.close()
             return version
 
+        # limit_parent_depth can be used to limit how far back we search the tree for a VERSION file.
+        if (max_parent_depth is not None):
+            if (max_parent_depth <= 0):
+                return None
+            max_parent_depth -= 1
+
         (cur_path, remainder) = os.path.split(cur_path)
         if not remainder:
             return None