From f340e404d50e0d065012a946164d3a86db653306 Mon Sep 17 00:00:00 2001
From: smjiao <smjiao@isoftstone.com>
Date: Wed, 13 Sep 2023 18:38:20 +0800
Subject: fix kv bug
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

---
 gala-ragdoll/ragdoll/utils/object_parse.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gala-ragdoll/ragdoll/utils/object_parse.py b/gala-ragdoll/ragdoll/utils/object_parse.py
index 3d0976e..83d22b7 100644
--- a/gala-ragdoll/ragdoll/utils/object_parse.py
+++ b/gala-ragdoll/ragdoll/utils/object_parse.py
@@ -71,7 +71,11 @@ class ObjectParse(object):
         conf_model.load_yang_model(yang_info)
 
         # load conf info
-        conf_model.read_conf(conf_info)
+        if conf_type == "kv":
+            spacer_type = self._yang_modules.getSpacerInModdule([yang_info])
+            conf_model.read_conf(conf_info, spacer_type, yang_info)
+        else:
+            conf_model.read_conf(conf_info)
 
         # to json
         conf_json = self.parse_model_to_json(conf_model)
@@ -96,6 +100,8 @@ class ObjectParse(object):
         conf_model.read_json(json_list)
         if conf_type == "sshd":
             conf_info = conf_model.write_conf(spacer_info)
+        elif conf_type == "kv":
+            conf_info = conf_model.write_conf(spacer_info, yang_info)
         else:
             # to content
             conf_info = conf_model.write_conf()
-- 
2.37.1.windows.1

