key_value_store: pull LoadKeyValueFile into a module
This isn't used too often, so lets pull it out into a standalone
module. It also has no real deps on other bits, so move it to
the utils namespaces.
BUG=chromium:997354
TEST=`./run_tests` passes
Change-Id: Ieee6b3476600cca98aaad7597cda57b6a79f3d55
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1790373
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/api/controller/test.py b/api/controller/test.py
index 51ac394..f83db28 100644
--- a/api/controller/test.py
+++ b/api/controller/test.py
@@ -24,6 +24,7 @@
from chromite.lib import sysroot_lib
from chromite.scripts import cros_set_lsb_release
from chromite.service import test
+from chromite.utils import key_value_store
def DebugInfoTest(input_proto, _output_proto, config):
@@ -160,7 +161,7 @@
partition_path = partition_paths[0]
lsb_release_file = os.path.join(partition_path,
constants.LSB_RELEASE_PATH.strip('/'))
- lsb_release_kvs = cros_build_lib.LoadKeyValueFile(lsb_release_file)
+ lsb_release_kvs = key_value_store.LoadFile(lsb_release_file)
builder = lsb_release_kvs.get(cros_set_lsb_release.LSB_KEY_BUILDER_PATH)
if not builder: