openubmc-bingo 0.5.253__py3-none-any.whl → 0.5.257__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of openubmc-bingo might be problematic. Click here for more details.
- bmcgo/__init__.py +1 -1
- bmcgo/codegen/lua/script/render_utils/client_lua.py +1 -0
- bmcgo/codegen/lua/script/utils.py +18 -0
- bmcgo/codegen/lua/templates/apps/Makefile +11 -0
- bmcgo/codegen/lua/v1/script/render_utils/model_lua.py +29 -0
- bmcgo/codegen/lua/v1/templates/apps/client.lua.mako +229 -0
- bmcgo/codegen/lua/v1/templates/apps/model.lua.mako +3 -0
- bmcgo/codegen/lua/v1/templates/apps/service.lua.mako +3 -41
- bmcgo/component/build.py +10 -1
- bmcgo/component/coverage/incremental_cov.py +2 -2
- bmcgo/functional/config.py +7 -0
- bmcgo/functional/json_check.py +109 -0
- bmcgo/misc.py +1 -0
- bmcgo/tasks/task_build_rootfs_img.py +2 -2
- bmcgo/utils/basic_enums.py +45 -0
- bmcgo/utils/json_validator.py +241 -0
- {openubmc_bingo-0.5.253.dist-info → openubmc_bingo-0.5.257.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.5.253.dist-info → openubmc_bingo-0.5.257.dist-info}/RECORD +21 -17
- {openubmc_bingo-0.5.253.dist-info → openubmc_bingo-0.5.257.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.5.253.dist-info → openubmc_bingo-0.5.257.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.5.253.dist-info → openubmc_bingo-0.5.257.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
|
@@ -279,6 +279,24 @@ class Utils:
|
|
|
279
279
|
if "tableName" in class_data and class_data.get("tableLocation") != "Local":
|
|
280
280
|
return True
|
|
281
281
|
return False
|
|
282
|
+
|
|
283
|
+
@staticmethod
|
|
284
|
+
def has_db(root: dict):
|
|
285
|
+
return Utils.check_need_mem_db(root) or Utils.check_local_poweroff_db(root) or \
|
|
286
|
+
Utils.check_local_reset_db(root) or Utils.check_local_temporary_db(root)
|
|
287
|
+
|
|
288
|
+
@staticmethod
|
|
289
|
+
def get_db_types(root: dict):
|
|
290
|
+
db_types = '{'
|
|
291
|
+
if Utils.check_need_mem_db(root):
|
|
292
|
+
db_types += "'memory', "
|
|
293
|
+
if Utils.check_local_poweroff_db(root):
|
|
294
|
+
db_types += "'local_poweroff', "
|
|
295
|
+
if Utils.check_local_reset_db(root):
|
|
296
|
+
db_types += "'local_reset', "
|
|
297
|
+
if Utils.check_local_temporary_db(root):
|
|
298
|
+
db_types += "'local_temporary', "
|
|
299
|
+
return db_types + '}'
|
|
282
300
|
|
|
283
301
|
@staticmethod
|
|
284
302
|
def check_need_mem_db(root: dict):
|
|
@@ -248,8 +248,13 @@ feature:
|
|
|
248
248
|
impl_feature:
|
|
249
249
|
endif
|
|
250
250
|
|
|
251
|
+
ifeq ($(MAJOR_VERSION_EQ_1), true)
|
|
252
|
+
orm_classes:
|
|
253
|
+
else
|
|
251
254
|
orm_classes: ${PROTO_OUT_DIR}/db_json.json
|
|
252
255
|
python3 ${TEMPLATE_BIN} -d ${PROTO_DIR} -j ${PROTO_OUT_DIR}/ -n ${PROJECT_NAME} -i ${PROTO_OUT_DIR}/db_json.json -f ${LUA_FORMATER} -t orm_classes.lua.mako -o ${GEN_OUT_DIR}/orm_classes.lua
|
|
256
|
+
endif
|
|
257
|
+
|
|
253
258
|
else
|
|
254
259
|
schema:
|
|
255
260
|
model:
|
|
@@ -276,9 +281,15 @@ client_messages: client_messages_json
|
|
|
276
281
|
-i ${PROTO_OUT_DIR}/json_types/$x -f ${LUA_FORMATER} -t message.lua.mako \
|
|
277
282
|
-o $(call proto_json_to_lua, ${GEN_OUT_DIR}/json_types/$x);) \
|
|
278
283
|
|
|
284
|
+
ifeq ($(MAJOR_VERSION_EQ_1), true)
|
|
285
|
+
${GEN_OUT_DIR}/client.lua : ${PROTO_OUT_DIR}/client.json ${TEMPLATE_BIN} \
|
|
286
|
+
${MAJOR_VERIONS_DIR}/v1/templates/apps/client.lua.mako utils/validate.mako utils/imports.mako client_messages message
|
|
287
|
+
python3 ${TEMPLATE_BIN} -d ${PROTO_DIR} -v ${VERSION} -j ${PROTO_OUT_DIR}/json_types/ -n ${PROJECT_NAME} -i ${PROTO_OUT_DIR}/client.json -f ${LUA_FORMATER} -t v1/templates/apps/client.lua.mako -o $@
|
|
288
|
+
else
|
|
279
289
|
${GEN_OUT_DIR}/client.lua : ${PROTO_OUT_DIR}/client.json ${TEMPLATE_BIN} \
|
|
280
290
|
client.lua.mako utils/validate.mako utils/imports.mako client_messages message
|
|
281
291
|
python3 ${TEMPLATE_BIN} -d ${PROTO_DIR} -v ${VERSION} -j ${PROTO_OUT_DIR}/json_types/ -n ${PROJECT_NAME} -i ${PROTO_OUT_DIR}/client.json -f ${LUA_FORMATER} -t client.lua.mako -o $@
|
|
292
|
+
endif
|
|
282
293
|
|
|
283
294
|
client: ${GEN_OUT_DIR}/client.lua
|
|
284
295
|
|
|
@@ -22,6 +22,10 @@ BASE_TYPE = "baseType"
|
|
|
22
22
|
ITEMS = "items"
|
|
23
23
|
NON_CONVERT_ITEMS = ["validator", "req_type", "rsp_type", "feature", "default_value", "read", "write"]
|
|
24
24
|
FILTERED_ITEMS = ["description", "$ref", "default", "items", "req", "rsp", "featureTag", "privilege"]
|
|
25
|
+
PERSIST_TYPES = {
|
|
26
|
+
"PermanentPer", "PoweroffPer", "ResetPer", "TemporaryPer", "PoweroffPerRetain",
|
|
27
|
+
"ResetPerRetain", "TemporaryPerRetain", "Memory"
|
|
28
|
+
}
|
|
25
29
|
OBJECT_PROPERTIES_INTERFACE = "bmc.kepler.Object.Properties"
|
|
26
30
|
|
|
27
31
|
|
|
@@ -67,6 +71,10 @@ class ConsistencyModelLuaUtils(Base, Utils):
|
|
|
67
71
|
def combine_privileges(privileges):
|
|
68
72
|
prefix = "privilege."
|
|
69
73
|
return prefix + (" | " + prefix).join(sorted(privileges))
|
|
74
|
+
|
|
75
|
+
@staticmethod
|
|
76
|
+
def prop_contains_persist_type(prop_config: dict):
|
|
77
|
+
return bool(set(prop_config.get("usage", [])) & PERSIST_TYPES)
|
|
70
78
|
|
|
71
79
|
def class_has_block_io(self, msg):
|
|
72
80
|
if self.has_path(msg):
|
|
@@ -175,6 +183,27 @@ class ConsistencyModelLuaUtils(Base, Utils):
|
|
|
175
183
|
return msg['path']
|
|
176
184
|
return msg['path'].replace(':parent/', self.get_path(root, root[msg['parent']]) + ':parent/')
|
|
177
185
|
|
|
186
|
+
def is_enable_orm(self, msg):
|
|
187
|
+
if "tableName" not in msg:
|
|
188
|
+
return False
|
|
189
|
+
|
|
190
|
+
if "tableLocation" in msg and msg["tableLocation"] == "Local":
|
|
191
|
+
return False
|
|
192
|
+
|
|
193
|
+
if "tableType" in msg:
|
|
194
|
+
return True
|
|
195
|
+
|
|
196
|
+
for _, prop_config in msg.get('properties', {}).items():
|
|
197
|
+
if self.prop_contains_persist_type(prop_config):
|
|
198
|
+
return True
|
|
199
|
+
|
|
200
|
+
for intf_data in msg.get('interfaces', {}).values():
|
|
201
|
+
for _, prop_config in intf_data.get('properties', {}).items():
|
|
202
|
+
if self.prop_contains_persist_type(prop_config):
|
|
203
|
+
return True
|
|
204
|
+
|
|
205
|
+
return False
|
|
206
|
+
|
|
178
207
|
def convert_dynamic_params(self, msg):
|
|
179
208
|
match_obj = re.search("\$\{(.+?)\}", msg)
|
|
180
209
|
if match_obj is None:
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
## 生成所有rpc接口
|
|
2
|
+
<%def name="get_obj(rpc)">
|
|
3
|
+
% if rpc['path'] != '*': ## 非虚方法和收集类方法,直接远程调用
|
|
4
|
+
% if 'paths' in rpc and not rpc['virtual']:
|
|
5
|
+
%if not rpc['retry']:
|
|
6
|
+
mdb.get_object(self:get_bus(), ${render_utils.make_path_with_params(rpc['full_path'])}, '${rpc['interface']}')
|
|
7
|
+
%else:
|
|
8
|
+
mdb.try_get_object(self:get_bus(), ${render_utils.get_object_path(rpc['full_path'])}, '${rpc['interface']}')
|
|
9
|
+
%endif
|
|
10
|
+
% else:
|
|
11
|
+
self:Get${rpc['class']}${rpc['intf_class']}Object(${render_utils.get_path_arg(rpc["full_path"], False)})
|
|
12
|
+
% endif
|
|
13
|
+
% elif not rpc['virtual']:
|
|
14
|
+
mdb.get_object(self:get_bus(), ${render_utils.make_path_with_params(rpc['full_path'])}, "${rpc['interface']}")
|
|
15
|
+
% else :
|
|
16
|
+
self:Get${rpc['intf_class']}Object()
|
|
17
|
+
% endif
|
|
18
|
+
</%def>
|
|
19
|
+
${make_header('lua')}
|
|
20
|
+
<% has_signal = root['signals']%>
|
|
21
|
+
<% has_interface = root['interfaces']%>
|
|
22
|
+
<% has_definite_path = any((rpc['path'] != '*') for rpc in root['interfaces'])%>
|
|
23
|
+
<% has_virtual = any((rpc['path'] == '*' and rpc['virtual']) for rpc in root['interfaces'])%>
|
|
24
|
+
<% has_implement = any((rpc['implement'] != '') for rpc in root['interfaces'])%>
|
|
25
|
+
<% has_non_virtual = any(((rpc['path'] == '*' or ((render_utils.get_path_params(rpc["full_path"]) or 'paths' in rpc))) and not rpc['virtual'] and rpc['implement'] == '') for rpc in root['interfaces'])%>
|
|
26
|
+
% if has_definite_path or has_implement:
|
|
27
|
+
local mdb = require 'mc.mdb'
|
|
28
|
+
% endif
|
|
29
|
+
local class = require 'mc.class'
|
|
30
|
+
local app_base = require 'mc.client_app_base'
|
|
31
|
+
% if has_signal or has_non_virtual:
|
|
32
|
+
local mdb_service = require 'mc.mdb.mdb_service'
|
|
33
|
+
% endif
|
|
34
|
+
% if has_interface:
|
|
35
|
+
local subscribe_signal = require 'mc.mdb.subscribe_signal'
|
|
36
|
+
% endif
|
|
37
|
+
% if has_signal:
|
|
38
|
+
local org_freedesktop_dbus = require 'sd_bus.org_freedesktop_dbus'
|
|
39
|
+
% endif
|
|
40
|
+
|
|
41
|
+
% if has_signal:
|
|
42
|
+
local match_rule = org_freedesktop_dbus.MatchRule
|
|
43
|
+
% endif
|
|
44
|
+
% if has_virtual:
|
|
45
|
+
local get_virtual_interface_object = mdb_service.get_virtual_interface_object
|
|
46
|
+
% endif
|
|
47
|
+
% if has_non_virtual:
|
|
48
|
+
local get_non_virtual_interface_objects = mdb_service.get_non_virtual_interface_objects
|
|
49
|
+
local foreach_non_virtual_interface_objects = mdb_service.foreach_non_virtual_interface_objects
|
|
50
|
+
% endif
|
|
51
|
+
|
|
52
|
+
## 生成对接口的依赖
|
|
53
|
+
% for intf, intf_data in root['intf_imports'].items():
|
|
54
|
+
% if intf_data['interface'].startswith('bmc.dev.'):
|
|
55
|
+
local ${intf} = require '${project_name}.device_types.${intf}'
|
|
56
|
+
%else:
|
|
57
|
+
local ${intf} = require '${project_name}.json_types.${intf}'
|
|
58
|
+
% endif
|
|
59
|
+
% endfor
|
|
60
|
+
|
|
61
|
+
<%namespace name="default_intf" file="../../../templates/apps/utils/default_intf.lua.mako"/>
|
|
62
|
+
<%namespace name="imports" file="../../../templates/apps/utils/imports.mako"/>
|
|
63
|
+
${imports.render(root)}
|
|
64
|
+
|
|
65
|
+
<%
|
|
66
|
+
ClassName = root['package'] + '_client'
|
|
67
|
+
%>
|
|
68
|
+
---@class ${ClassName}: BasicClient
|
|
69
|
+
local ${ClassName} = class(app_base.Client)
|
|
70
|
+
|
|
71
|
+
% if has_implement:
|
|
72
|
+
${default_intf.add_subs(ClassName)}
|
|
73
|
+
% endif
|
|
74
|
+
## 收集复写类方法订阅接口
|
|
75
|
+
% for rpc in root['interfaces']:
|
|
76
|
+
% if rpc['path'] == '*' and rpc['virtual']:
|
|
77
|
+
|
|
78
|
+
function ${ClassName}:Get${rpc['intf_class']}Object()
|
|
79
|
+
return get_virtual_interface_object(self:get_bus(), '${rpc['interface']}')
|
|
80
|
+
end
|
|
81
|
+
% endif
|
|
82
|
+
%endfor
|
|
83
|
+
## 生成收集类client订阅接口
|
|
84
|
+
% for rpc in root['interfaces']:
|
|
85
|
+
%if rpc['path'] == '*' and not rpc['virtual'] and rpc['implement'] == '':
|
|
86
|
+
|
|
87
|
+
function ${ClassName}:Get${rpc['intf_class']}Objects()
|
|
88
|
+
return get_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', ${'true' if rpc['retry'] else 'false'})
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
function ${ClassName}:Foreach${rpc['intf_class']}Objects(cb)
|
|
92
|
+
return foreach_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', cb, ${'true' if rpc['retry'] else 'false'})
|
|
93
|
+
end
|
|
94
|
+
% endif
|
|
95
|
+
%endfor
|
|
96
|
+
|
|
97
|
+
## 生成默认对象的订阅和访问接口
|
|
98
|
+
% for rpc in root['interfaces']:
|
|
99
|
+
%if rpc['implement'] != '' :
|
|
100
|
+
<% default_path = ClassName +'.'+ rpc['intf_class'] +"_default" %>
|
|
101
|
+
${default_intf.render(default_path, ClassName, rpc['intf_class'], rpc['interface'])}
|
|
102
|
+
% endif
|
|
103
|
+
%endfor
|
|
104
|
+
|
|
105
|
+
% for rpc in root['interfaces']:
|
|
106
|
+
% if 'paths' in rpc and not rpc['virtual']:
|
|
107
|
+
function ${ClassName}:MutipleGet${rpc['intf_class']}Objects()
|
|
108
|
+
return get_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns(rpc["paths"])})
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
function ${ClassName}:MutipleForeach${rpc['intf_class']}Objects(cb)
|
|
112
|
+
return foreach_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', cb, ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns(rpc["paths"])})
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
% if rpc['dep_properties']:
|
|
116
|
+
function ${ClassName}:MutipleOn${rpc['intf_class']}PropertiesChanged(cb)
|
|
117
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), ${render_utils.get_path_patterns(rpc["paths"])}, cb, '${rpc['interface']}'${render_utils.get_dep_properties(rpc["dep_properties"])})
|
|
118
|
+
end
|
|
119
|
+
%endif
|
|
120
|
+
|
|
121
|
+
function ${ClassName}:MutipleOn${rpc['intf_class']}InterfacesAdded(cb)
|
|
122
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), ${render_utils.get_path_patterns(rpc["paths"])}, cb, '${rpc['interface']}')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
function ${ClassName}:MutipleOn${rpc['intf_class']}InterfacesRemoved(cb)
|
|
126
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), ${render_utils.get_path_patterns(rpc["paths"])}, cb, '${rpc['interface']}')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
<% continue %>
|
|
130
|
+
% endif
|
|
131
|
+
% if rpc['path'] != '*':
|
|
132
|
+
function ${ClassName}:Get${rpc['name']}Object(${render_utils.get_path_arg(rpc["full_path"], False)})
|
|
133
|
+
%if not rpc['retry']:
|
|
134
|
+
return mdb.get_object(self:get_bus(), ${render_utils.make_path_with_params(rpc['full_path'])}, '${rpc['interface']}')
|
|
135
|
+
%else:
|
|
136
|
+
return mdb.try_get_object(self:get_bus(), ${render_utils.get_object_path(rpc['full_path'])}, '${rpc['interface']}')
|
|
137
|
+
%endif
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
% if render_utils.get_path_params(rpc["full_path"]):
|
|
141
|
+
function ${ClassName}:Get${rpc['intf_class']}Objects()
|
|
142
|
+
return get_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns([rpc["full_path"]])})
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
function ${ClassName}:Foreach${rpc['intf_class']}Objects(cb)
|
|
146
|
+
return foreach_non_virtual_interface_objects(self:get_bus(), '${rpc['interface']}', cb, ${'true' if rpc['retry'] else 'false'}, ${render_utils.get_path_patterns([rpc["full_path"]])})
|
|
147
|
+
end
|
|
148
|
+
%endif
|
|
149
|
+
|
|
150
|
+
% if rpc['dep_properties']:
|
|
151
|
+
function ${ClassName}:On${rpc['intf_class']}PropertiesChanged(cb${render_utils.get_path_arg(rpc["full_path"])})
|
|
152
|
+
local path_namespace = ${render_utils.get_path_namespace(rpc['full_path'])}
|
|
153
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), path_namespace, cb, '${rpc['interface']}'${render_utils.get_dep_properties(rpc["dep_properties"])})
|
|
154
|
+
end
|
|
155
|
+
%endif
|
|
156
|
+
|
|
157
|
+
function ${ClassName}:On${rpc['intf_class']}InterfacesAdded(cb${render_utils.get_path_arg(rpc["full_path"])})
|
|
158
|
+
local path_namespace = ${render_utils.get_path_namespace(rpc['full_path'])}
|
|
159
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb, '${rpc['interface']}')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
function ${ClassName}:On${rpc['intf_class']}InterfacesRemoved(cb${render_utils.get_path_arg(rpc["full_path"])})
|
|
163
|
+
local path_namespace = ${render_utils.get_path_namespace(rpc['full_path'])}
|
|
164
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace, cb, '${rpc['interface']}')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
% else :
|
|
168
|
+
% if rpc['dep_properties']:
|
|
169
|
+
function ${ClassName}:On${rpc['intf_class']}PropertiesChanged(cb)
|
|
170
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb, '${rpc['interface']}'${render_utils.get_dep_properties(rpc["dep_properties"])})
|
|
171
|
+
end
|
|
172
|
+
%endif
|
|
173
|
+
|
|
174
|
+
function ${ClassName}:On${rpc['intf_class']}InterfacesAdded(cb)
|
|
175
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb, '${rpc['interface']}')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
function ${ClassName}:On${rpc['intf_class']}InterfacesRemoved(cb)
|
|
179
|
+
self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb, '${rpc['interface']}')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
% endif
|
|
183
|
+
%endfor
|
|
184
|
+
% for rpc in root['methods']:
|
|
185
|
+
%if rpc['path'] == '*' and not rpc['virtual']:
|
|
186
|
+
<% continue %>
|
|
187
|
+
% endif
|
|
188
|
+
% for p in render_utils.props(rpc['req']): ## 生成参数注释
|
|
189
|
+
---@param ${p['name']} ${utils_py.do_type_to_lua(p['type'], p['repeated'])}
|
|
190
|
+
% endfor
|
|
191
|
+
% if render_utils.rsp_message(rpc) != 'nil': ## 生成返回值注释
|
|
192
|
+
---@return ${render_utils.rsp_message(rpc)}
|
|
193
|
+
% endif
|
|
194
|
+
% if len(render_utils.params(rpc['req'])) == 0: ## 区分参数个数生成参数, 没有参数的b
|
|
195
|
+
function ${ClassName}:${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])})
|
|
196
|
+
local obj = ${get_obj(rpc)}
|
|
197
|
+
return ${render_utils.rsp_message(rpc)}.new(obj:${rpc['func_name']}(ctx))
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
function ${ClassName}:P${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])})
|
|
201
|
+
return pcall(self.${rpc['name']}, self, ctx${render_utils.get_path_arg(rpc["full_path"])})
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
% else: ## 有参数的
|
|
205
|
+
function ${ClassName}:${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])}, ${render_utils.params(rpc['req'])})
|
|
206
|
+
local req = ${render_utils.req_message(rpc)}.new(${render_utils.params(rpc['req'])}):validate()
|
|
207
|
+
local obj = ${get_obj(rpc)}return ${render_utils.rsp_message(rpc)}.new(obj:${rpc['func_name']}(ctx, req:unpack(true)))
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
function ${ClassName}:P${rpc['name']}(ctx${render_utils.get_path_arg(rpc["full_path"])}, ${render_utils.params(rpc['req'])})
|
|
211
|
+
return pcall(self.${rpc['name']}, self, ctx${render_utils.get_path_arg(rpc["full_path"])}, ${render_utils.params(rpc['req'])})
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
% endif
|
|
215
|
+
% endfor
|
|
216
|
+
## 生成信号订阅接口
|
|
217
|
+
% for signal in root['signals']:
|
|
218
|
+
function ${ClassName}:Subscribe${signal['name']}(cb)
|
|
219
|
+
local sig = match_rule.signal('${signal['signal_name']}', '${signal['interface']}')${'' if signal['path'] == '*' else (':with_path("' +signal['path']+'")')}
|
|
220
|
+
self.signal_slots[#self.signal_slots+1] = subscribe_signal.subscribe(self:get_bus(), sig, cb)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
% endfor
|
|
224
|
+
function ${ClassName}:ctor()
|
|
225
|
+
self.signal_slots = {}
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
---@type ${ClassName}
|
|
229
|
+
return ${ClassName}.new('${root['package']}')
|
|
@@ -17,6 +17,9 @@ classes.${class_name} = {
|
|
|
17
17
|
% if render_utils.has_table_name(msg):
|
|
18
18
|
['table_name'] = '${msg['tableName']}',
|
|
19
19
|
% endif
|
|
20
|
+
% if render_utils.is_enable_orm(msg):
|
|
21
|
+
['enable_orm'] = true,
|
|
22
|
+
% endif
|
|
20
23
|
% if render_utils.has_alias(msg):
|
|
21
24
|
['alias_map'] = ${render_utils.get_alias_map(msg)},
|
|
22
25
|
% endif
|
|
@@ -13,33 +13,18 @@ local ipmi = require 'ipmi'
|
|
|
13
13
|
% if has_default or has_mdb:
|
|
14
14
|
local mdb = require 'mc.mdb'
|
|
15
15
|
% endif
|
|
16
|
-
% if utils_py.check_local_reset_db(root) or utils_py.check_local_temporary_db(root):
|
|
17
|
-
local skynet = require 'skynet'
|
|
18
|
-
% endif
|
|
19
16
|
local class = require 'mc.class'
|
|
20
17
|
% if has_signal:
|
|
21
18
|
local context = require 'mc.context'
|
|
22
19
|
% endif
|
|
23
20
|
local c = require 'mc.class_mgnt'
|
|
24
|
-
% if utils_py.check_need_mem_db(root):
|
|
25
|
-
local open_db = require '${project_name}.db'
|
|
26
|
-
% endif
|
|
27
21
|
local bootstrap = require 'mc.bootstrap'
|
|
28
|
-
% if utils_py.check_local_poweroff_db(root) or utils_py.check_local_reset_db(root) or utils_py.check_local_temporary_db(root):
|
|
29
|
-
local open_local_db = require '${project_name}.local_db'
|
|
30
|
-
% endif
|
|
31
22
|
% if (root['path_level'] == 2 and utils_py.check_db_open(root['package']) and utils_py.check_remote_per(root)) or root['class_require']:
|
|
32
23
|
local object_manage = require 'mc.mdb.object_manage'
|
|
33
24
|
% endif
|
|
34
25
|
% if root['path_level'] == 2 and utils_py.check_db_open(root['package']) and utils_py.check_remote_per(root):
|
|
35
26
|
local persist_client = require 'persistence.persist_client_lib'
|
|
36
27
|
% endif
|
|
37
|
-
% if utils_py.check_need_mem_db(root) or utils_py.check_need_local_db(root):
|
|
38
|
-
local ok, datas = pcall(require, '${project_name}.datas')
|
|
39
|
-
if not ok then
|
|
40
|
-
datas = nil -- 如果没有datas配置,证明当前组件不需要datas,仅打开数据库
|
|
41
|
-
end
|
|
42
|
-
% endif
|
|
43
28
|
|
|
44
29
|
% for intf, intf_data in root['intf_imports'].items():
|
|
45
30
|
local ${intf}Types = require '${project_name}.json_types.${intf}'
|
|
@@ -135,32 +120,10 @@ end
|
|
|
135
120
|
% endif
|
|
136
121
|
|
|
137
122
|
function ${ClassName}:ctor(${"" if root['path_level'] == 2 else "bus"})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
self.db = open_db(':memory:', datas)
|
|
141
|
-
% endif
|
|
142
|
-
% if root['path_level'] == 2:
|
|
143
|
-
% if utils_py.check_local_poweroff_db(root):
|
|
144
|
-
self.local_db = open_local_db(bootstrap.Service:get_local_db_path(self.name) .. '/${project_name}.db', datas, 'poweroff')
|
|
145
|
-
% endif
|
|
146
|
-
% endif
|
|
147
|
-
% if utils_py.check_local_reset_db(root) or utils_py.check_local_temporary_db(root):
|
|
148
|
-
if skynet.getenv('TEST_DATA_DIR') then
|
|
149
|
-
% if utils_py.check_local_reset_db(root):
|
|
150
|
-
self.reset_local_db = open_local_db(skynet.getenv('TEST_DATA_DIR')..'/${project_name}_reset.db', datas, "reset")
|
|
151
|
-
% endif
|
|
152
|
-
% if utils_py.check_local_temporary_db(root):
|
|
153
|
-
self.temporary_local_db = open_local_db(skynet.getenv('TEST_DATA_DIR')..'/${project_name}_temp.db', datas, "temporary")
|
|
154
|
-
% endif
|
|
155
|
-
else
|
|
156
|
-
% if utils_py.check_local_reset_db(root):
|
|
157
|
-
self.reset_local_db = open_local_db('/opt/bmc/pram/persistence.local/${project_name}.db', datas, "reset")
|
|
158
|
-
% endif
|
|
159
|
-
% if utils_py.check_local_temporary_db(root):
|
|
160
|
-
self.temporary_local_db = open_local_db('/dev/shm/persistence.local/${project_name}.db', datas, "temporary")
|
|
161
|
-
% endif
|
|
162
|
-
end
|
|
123
|
+
% if utils_py.has_db(root):
|
|
124
|
+
self.db_types = ${utils_py.get_db_types(root)}
|
|
163
125
|
% endif
|
|
126
|
+
self.name = '${project_name}'
|
|
164
127
|
end
|
|
165
128
|
|
|
166
129
|
% if root['path_level'] == 2:
|
|
@@ -168,7 +131,6 @@ function ${ClassName}:pre_init()
|
|
|
168
131
|
${ClassName}.super.pre_init(self)
|
|
169
132
|
% if utils_py.check_remote_per(root):
|
|
170
133
|
self.persist = persist_client.new(self.bus, self.db, self, ${render_utils.get_not_recover_tables(root)})
|
|
171
|
-
object_manage.set_persist_client(self.persist)
|
|
172
134
|
% endif
|
|
173
135
|
end
|
|
174
136
|
% endif
|
bmcgo/component/build.py
CHANGED
|
@@ -26,6 +26,7 @@ from bmcgo.errors import BmcGoException
|
|
|
26
26
|
from bmcgo.component.package_info import InfoComp
|
|
27
27
|
from bmcgo.component.component_helper import ComponentHelper
|
|
28
28
|
from bmcgo import misc
|
|
29
|
+
from bmcgo.utils.json_validator import JSONValidator
|
|
29
30
|
|
|
30
31
|
log = Logger()
|
|
31
32
|
tool = Tools()
|
|
@@ -172,9 +173,9 @@ class BuildComp():
|
|
|
172
173
|
tool.run_command(cmd, show_log=True)
|
|
173
174
|
|
|
174
175
|
def run(self):
|
|
176
|
+
tool.clean_locks()
|
|
175
177
|
self.check_conan_profile()
|
|
176
178
|
self.check_luac()
|
|
177
|
-
tool.clean_locks()
|
|
178
179
|
from_source = "--build=missing"
|
|
179
180
|
if self.info.from_source:
|
|
180
181
|
from_source = "--build"
|
|
@@ -186,6 +187,7 @@ class BuildComp():
|
|
|
186
187
|
cmd = [misc.CONAN, "create"]
|
|
187
188
|
cmd += append.split()
|
|
188
189
|
tool.run_command(cmd, show_log=True)
|
|
190
|
+
self._check_sr_validation(cache_dir)
|
|
189
191
|
self.upload()
|
|
190
192
|
|
|
191
193
|
def test(self):
|
|
@@ -194,3 +196,10 @@ class BuildComp():
|
|
|
194
196
|
cmd += self.info.cmd_base.split()
|
|
195
197
|
cmd += ["-tf", "test_package"]
|
|
196
198
|
Helper.run(cmd)
|
|
199
|
+
|
|
200
|
+
def _check_sr_validation(self, dir_path):
|
|
201
|
+
# 检查所有 sr 文件是否合法
|
|
202
|
+
log.info("========== sr 文件检查开始 ==========")
|
|
203
|
+
jc = self.bconfig.bmcgo_config_list.get(misc.ENV_CONST, {}).get(misc.JSON_CHECKER, None)
|
|
204
|
+
JSONValidator().validate_files(dir_path, ['sr'], jc)
|
|
205
|
+
log.info("========== sr 文件检查结束 ==========")
|
|
@@ -146,10 +146,10 @@ class IncrementalCov(object):
|
|
|
146
146
|
cov = cov_lines[file]
|
|
147
147
|
|
|
148
148
|
for change in change_lines:
|
|
149
|
-
if filters[change] == 0:
|
|
149
|
+
if filters[change - 1] == 0:
|
|
150
150
|
continue
|
|
151
151
|
temp_changes.append(change)
|
|
152
|
-
if not cov or not cov[change]:
|
|
152
|
+
if not cov or not cov[change - 1]:
|
|
153
153
|
temp_uncovers.append(change)
|
|
154
154
|
lua_changes[file] = temp_changes
|
|
155
155
|
uncovers[file] = temp_uncovers
|
bmcgo/functional/config.py
CHANGED
|
@@ -14,6 +14,7 @@ import os
|
|
|
14
14
|
import stat
|
|
15
15
|
import re
|
|
16
16
|
import argparse
|
|
17
|
+
from pathlib import Path
|
|
17
18
|
|
|
18
19
|
from bmcgo import misc
|
|
19
20
|
from bmcgo.utils.tools import Tools
|
|
@@ -59,6 +60,12 @@ _CONFIGS = {
|
|
|
59
60
|
misc.JARSIGNER_HTTP_PROXY: {
|
|
60
61
|
misc.DESCRIPTION: "",
|
|
61
62
|
misc.PATTERN: r"^((https?://)?[a-zA-Z0-9.]+:[0-9]+)?$"
|
|
63
|
+
},
|
|
64
|
+
misc.JSON_CHECKER: {
|
|
65
|
+
misc.DESCRIPTION: "检查 json 文件的工具"
|
|
66
|
+
},
|
|
67
|
+
misc.CUSTOM_PLUGINS: {
|
|
68
|
+
misc.DESCRIPTION: f"设置插件地址,默认 {Path(misc.DEFAULT_PLUGINS_PATH).resolve()}"
|
|
62
69
|
}
|
|
63
70
|
},
|
|
64
71
|
misc.DEPLOY_HOST_CONST: {
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# encoding=utf-8
|
|
3
|
+
# 描述:bingo 配置默认参数功能
|
|
4
|
+
# Copyright (c) 2025 Huawei Technologies Co., Ltd.
|
|
5
|
+
# openUBMC is licensed under Mulan PSL v2.
|
|
6
|
+
# You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
7
|
+
# You may obtain a copy of Mulan PSL v2 at:
|
|
8
|
+
# http://license.coscl.org.cn/MulanPSL2
|
|
9
|
+
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
|
10
|
+
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
|
11
|
+
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
12
|
+
# See the Mulan PSL v2 for more details.
|
|
13
|
+
import os
|
|
14
|
+
import re
|
|
15
|
+
import argparse
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
from bmcgo import misc
|
|
19
|
+
from bmcgo.utils.tools import Tools
|
|
20
|
+
from bmcgo.utils.json_validator import JsonTypeEnum, JSONValidator, get_cpu_count
|
|
21
|
+
from bmcgo.bmcgo_config import BmcgoConfig
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
tools = Tools("JSONChecker")
|
|
25
|
+
logger = tools.log
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
command_info: misc.CommandInfo = misc.CommandInfo(
|
|
29
|
+
group=misc.GRP_MISC,
|
|
30
|
+
name="json_check",
|
|
31
|
+
description=["json 文件检查"],
|
|
32
|
+
hidden=False
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def if_available(bconfig: BmcgoConfig):
|
|
37
|
+
return True
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
CMD = "bingo"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def get_desc(cmd):
|
|
44
|
+
|
|
45
|
+
return f"""
|
|
46
|
+
json 文件合法性检查工具:
|
|
47
|
+
|
|
48
|
+
1. 检查当前路径下所有 sr 文件:
|
|
49
|
+
>> {cmd} json_test -e sr
|
|
50
|
+
|
|
51
|
+
2. 检查其他路径下所有 sr, json, jn 文件:
|
|
52
|
+
>> {cmd} json_test -p /path/to/test/ -e .sr,json,jn
|
|
53
|
+
|
|
54
|
+
3. 用其他工具检查,比如 pyjson5, json5 (需要提前通过 pip 安装):
|
|
55
|
+
>> {cmd} json_test -e sr -j pyjson5
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
DEFAULT_JSON_TYPE = JsonTypeEnum.JSON
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class BmcgoCommand:
|
|
62
|
+
def __init__(self, bconfig: BmcgoConfig, *args):
|
|
63
|
+
self.bconfig = bconfig
|
|
64
|
+
jc = self.bconfig.bmcgo_config_list.get(misc.ENV_CONST, {}).get(misc.JSON_CHECKER, DEFAULT_JSON_TYPE)
|
|
65
|
+
|
|
66
|
+
parser = argparse.ArgumentParser(
|
|
67
|
+
prog=f"{CMD}参数配置",
|
|
68
|
+
description=get_desc(CMD),
|
|
69
|
+
add_help=True,
|
|
70
|
+
formatter_class=argparse.RawTextHelpFormatter
|
|
71
|
+
)
|
|
72
|
+
parser.add_argument(
|
|
73
|
+
"-p",
|
|
74
|
+
"--path",
|
|
75
|
+
type=Path,
|
|
76
|
+
default=Path(".").resolve(),
|
|
77
|
+
help="文件路径:检查单个文件合法性;文件夹路径:递归遍历所有指定拓展名文件合法性"
|
|
78
|
+
)
|
|
79
|
+
parser.add_argument(
|
|
80
|
+
"-e",
|
|
81
|
+
"--extensions",
|
|
82
|
+
type=lambda s: [ext.strip().lstrip('.').lower() for ext in re.split(r'\s*[,,]\s*', s) if ext],
|
|
83
|
+
required=True,
|
|
84
|
+
help="需要检查的文件后缀,通过','分隔,比如 -e sr,json"
|
|
85
|
+
)
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
"-j",
|
|
88
|
+
"--json-type",
|
|
89
|
+
choices=list(JsonTypeEnum),
|
|
90
|
+
default=jc,
|
|
91
|
+
help=f"选择检查工具,可以通过 {CMD} config {misc.ENV_CONST}.{misc.JSON_CHECKER}=json/json5/pyjson5 指定默认值,当前为:{jc}\n"
|
|
92
|
+
"选择其他工具请先确认是否已经安装"
|
|
93
|
+
)
|
|
94
|
+
parser.add_argument(
|
|
95
|
+
"-n",
|
|
96
|
+
"--worker-num",
|
|
97
|
+
type=int,
|
|
98
|
+
default=get_cpu_count() * 2,
|
|
99
|
+
help=f"指定并行处理器数目,默认为{get_cpu_count() * 2}"
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
self.args, self.kwargs = parser.parse_known_args(*args)
|
|
103
|
+
self.logger = tools.log
|
|
104
|
+
self._json_checker = JSONValidator()
|
|
105
|
+
|
|
106
|
+
def run(self):
|
|
107
|
+
self._json_checker.validate_files(
|
|
108
|
+
self.args.path, self.args.extensions, self.args.json_type, self.args.worker_num)
|
|
109
|
+
return 0
|
bmcgo/misc.py
CHANGED
|
@@ -277,7 +277,7 @@ class TaskClass(Task):
|
|
|
277
277
|
soft_sr_file_path = os.path.join(sr_dir, soft_sr_file_name)
|
|
278
278
|
if not os.path.exists(soft_sr_file_path):
|
|
279
279
|
return
|
|
280
|
-
|
|
280
|
+
soft_sr_file_permission = self.tools.get_file_permission(soft_sr_file_path)
|
|
281
281
|
self.run_command(f"chmod 777 {soft_sr_file_path}", sudo=True, command_echo=False)
|
|
282
282
|
with open(soft_sr_file_path, "r") as fp:
|
|
283
283
|
soft_sr_data = json.load(fp)
|
|
@@ -288,7 +288,7 @@ class TaskClass(Task):
|
|
|
288
288
|
if key in soft_sr_data['Objects']:
|
|
289
289
|
sr_data['Objects'][key] = {**value, **soft_sr_data['Objects'][key]}
|
|
290
290
|
sr_data['Objects'] = {**soft_sr_data['Objects'], **sr_data['Objects']}
|
|
291
|
-
self.run_command(f"chmod {
|
|
291
|
+
self.run_command(f"chmod {soft_sr_file_permission} {soft_sr_file_path}", sudo=True, command_echo=False)
|
|
292
292
|
except Exception as e:
|
|
293
293
|
raise Exception(f"{sr_file.path} 文件合并失败: {e}") from e
|
|
294
294
|
try:
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Copyright (c) 2025 Huawei Technologies Co., Ltd.
|
|
4
|
+
# openUBMC is licensed under Mulan PSL v2.
|
|
5
|
+
# You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
6
|
+
# You may obtain a copy of Mulan PSL v2 at:
|
|
7
|
+
# http://license.coscl.org.cn/MulanPSL2
|
|
8
|
+
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
|
9
|
+
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
|
10
|
+
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
11
|
+
# See the Mulan PSL v2 for more details.
|
|
12
|
+
from enum import Enum, EnumMeta, auto
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class StringEnumMeta(EnumMeta):
|
|
16
|
+
def __contains__(cls, value):
|
|
17
|
+
return value in cls._value2member_map_
|
|
18
|
+
|
|
19
|
+
def __iter__(cls):
|
|
20
|
+
return (mem.value for mem in super().__iter__())
|
|
21
|
+
|
|
22
|
+
def __repr__(cls):
|
|
23
|
+
return repr(list(cls))
|
|
24
|
+
|
|
25
|
+
def __str__(cls):
|
|
26
|
+
return str(list(cls))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class BaseStringEnum(str, Enum, metaclass=StringEnumMeta):
|
|
30
|
+
def __str__(self):
|
|
31
|
+
return self.value
|
|
32
|
+
|
|
33
|
+
def __repr__(self):
|
|
34
|
+
return f"'{self.value}'"
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
def _generate_next_value_(name, start, count, last_values):
|
|
38
|
+
return name.lower()
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def _missing_(cls, value):
|
|
42
|
+
for mem in cls:
|
|
43
|
+
if mem.value.lower() == value:
|
|
44
|
+
return mem
|
|
45
|
+
return None
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
#!/usr/bin/python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Copyright (c) 2025 Huawei Technologies Co., Ltd.
|
|
4
|
+
# openUBMC is licensed under Mulan PSL v2.
|
|
5
|
+
# You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
6
|
+
# You may obtain a copy of Mulan PSL v2 at:
|
|
7
|
+
# http://license.coscl.org.cn/MulanPSL2
|
|
8
|
+
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
|
9
|
+
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
|
10
|
+
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
11
|
+
# See the Mulan PSL v2 for more details.
|
|
12
|
+
import os
|
|
13
|
+
import re
|
|
14
|
+
import argparse
|
|
15
|
+
import concurrent.futures
|
|
16
|
+
from enum import auto
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from typing import Callable, List, Optional
|
|
19
|
+
|
|
20
|
+
from bmcgo.utils.tools import Tools
|
|
21
|
+
from bmcgo.utils.basic_enums import BaseStringEnum
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
tools = Tools("JSONChecker")
|
|
25
|
+
logger = tools.log
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class JsonTypeEnum(BaseStringEnum):
|
|
29
|
+
JSON = auto()
|
|
30
|
+
JSON5 = auto()
|
|
31
|
+
PYJSON5 = auto()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class JSONValidator:
|
|
35
|
+
def __init__(self):
|
|
36
|
+
self.logger = tools.log
|
|
37
|
+
|
|
38
|
+
self.loaders = {
|
|
39
|
+
JsonTypeEnum.JSON: load_json,
|
|
40
|
+
JsonTypeEnum.JSON5: load_json5,
|
|
41
|
+
JsonTypeEnum.PYJSON5: load_pyjson5
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
def validate_files(
|
|
45
|
+
self,
|
|
46
|
+
root_path: Path,
|
|
47
|
+
extensions: List[str],
|
|
48
|
+
json_type: JsonTypeEnum = JsonTypeEnum.JSON,
|
|
49
|
+
max_workers: Optional[int] = None
|
|
50
|
+
):
|
|
51
|
+
root_path = Path(root_path)
|
|
52
|
+
files = find_files(root_path, extensions)
|
|
53
|
+
|
|
54
|
+
if not files:
|
|
55
|
+
self.logger.info(f"没有找到{extensions}后缀的文件!")
|
|
56
|
+
return
|
|
57
|
+
|
|
58
|
+
loader = self._get_loader(json_type)
|
|
59
|
+
fails = {}
|
|
60
|
+
|
|
61
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
|
|
62
|
+
future_to_file = {executor.submit(validate, file, loader): file for file in files}
|
|
63
|
+
|
|
64
|
+
for future in concurrent.futures.as_completed(future_to_file):
|
|
65
|
+
file_path = future_to_file[future]
|
|
66
|
+
try:
|
|
67
|
+
error = future.result()
|
|
68
|
+
if error:
|
|
69
|
+
self.logger.debug(f"{str(file_path)}: Failed!")
|
|
70
|
+
fails[file_path] = error
|
|
71
|
+
else:
|
|
72
|
+
self.logger.debug(f"{str(file_path)}: PASS!")
|
|
73
|
+
except Exception as e:
|
|
74
|
+
self.logger.error(f"{file_path} - {str(e)}")
|
|
75
|
+
|
|
76
|
+
self._print_summary(fails)
|
|
77
|
+
if fails:
|
|
78
|
+
raise ValueError("JSON 格式错误!")
|
|
79
|
+
|
|
80
|
+
def _get_loader(self, json_type: JsonTypeEnum):
|
|
81
|
+
if json_type == JsonTypeEnum.JSON5:
|
|
82
|
+
try:
|
|
83
|
+
import json5
|
|
84
|
+
except ImportError:
|
|
85
|
+
self.logger.warning("json5 不可用,使用 json 检查")
|
|
86
|
+
json_type = JsonTypeEnum.JSON
|
|
87
|
+
elif json_type == JsonTypeEnum.PYJSON5:
|
|
88
|
+
try:
|
|
89
|
+
import pyjson5
|
|
90
|
+
except ImportError:
|
|
91
|
+
self.logger.warning("pyjson5 不可用,使用 json 检查")
|
|
92
|
+
json_type = JsonTypeEnum.JSON
|
|
93
|
+
else:
|
|
94
|
+
json_type = JsonTypeEnum.JSON
|
|
95
|
+
|
|
96
|
+
return self.loaders.get(json_type)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _print_summary(self, fails):
|
|
100
|
+
if fails:
|
|
101
|
+
self.logger.error("json 检查找到以下错误:")
|
|
102
|
+
for path, err in fails.items():
|
|
103
|
+
self.logger.error(f"{path}")
|
|
104
|
+
for detail in err:
|
|
105
|
+
self.logger.error(detail)
|
|
106
|
+
else:
|
|
107
|
+
self.logger.info("json 检查全部通过!")
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def format_error_position(content: str, message: str, position: int, window: int = 50):
|
|
111
|
+
lines = content.splitlines()
|
|
112
|
+
curr_pos = 0
|
|
113
|
+
for ln, line in enumerate(lines, 1):
|
|
114
|
+
if curr_pos + len(line) >= position:
|
|
115
|
+
start = max(0, position - curr_pos - window)
|
|
116
|
+
end = min(len(line), position - curr_pos + window)
|
|
117
|
+
|
|
118
|
+
snippet = line[start:end]
|
|
119
|
+
marker = " " * (position - curr_pos - start) + "↑"
|
|
120
|
+
if start > 0:
|
|
121
|
+
marker = " " * 3 + marker
|
|
122
|
+
|
|
123
|
+
prefix = "..." if start > 0 else ""
|
|
124
|
+
suffix = "..." if end < len(line) else ""
|
|
125
|
+
|
|
126
|
+
return (f"Line {ln}: {message}", f"{prefix}{snippet}{suffix}", f"{marker} ({position - curr_pos + 1})")
|
|
127
|
+
curr_pos += len(line) + 1
|
|
128
|
+
return ""
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def format_error_row_and_col(content: str, message: str, lineno: int, colno: int, window: int = 50):
|
|
132
|
+
lines = content.splitlines()
|
|
133
|
+
for ln, line in enumerate(lines, 1):
|
|
134
|
+
if ln != lineno:
|
|
135
|
+
continue
|
|
136
|
+
|
|
137
|
+
start = max(0, colno - window)
|
|
138
|
+
end = min(len(line), colno + window)
|
|
139
|
+
|
|
140
|
+
snippet = line[start:end]
|
|
141
|
+
marker = " " * (colno - start - 1) + "↑"
|
|
142
|
+
if start > 0:
|
|
143
|
+
marker = " " * 3 + marker
|
|
144
|
+
|
|
145
|
+
prefix = "..." if start > 0 else ""
|
|
146
|
+
suffix = "..." if end < len(line) else ""
|
|
147
|
+
|
|
148
|
+
return (f"Line {ln}: {message}", f"{prefix}{snippet}{suffix}", f"{marker} ({colno})")
|
|
149
|
+
return ""
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def format_error(error: Exception, content: str, file_path: Path):
|
|
153
|
+
error_msg = str(error)
|
|
154
|
+
pos = getattr(error, 'pos', None)
|
|
155
|
+
if pos is not None:
|
|
156
|
+
return format_error_position(content, error_msg, error.pos)
|
|
157
|
+
|
|
158
|
+
args = getattr(error, 'args')
|
|
159
|
+
if args:
|
|
160
|
+
msg = args[0]
|
|
161
|
+
|
|
162
|
+
result = re.search(r"<string>:(\d+)\s+(.+?)\s+at column\s+(\d+)", msg)
|
|
163
|
+
if result:
|
|
164
|
+
lineno = int(result.group(1))
|
|
165
|
+
colno = int(result.group(3))
|
|
166
|
+
reason = result.group(2)
|
|
167
|
+
|
|
168
|
+
return format_error_row_and_col(content, reason, lineno=lineno, colno=colno)
|
|
169
|
+
|
|
170
|
+
result = re.search(r"near (\d+)", msg)
|
|
171
|
+
if result:
|
|
172
|
+
pos = int(result.group(1)) - 1
|
|
173
|
+
return format_error_position(content, msg, pos)
|
|
174
|
+
|
|
175
|
+
# 需要以 tuple 返回,和 format_error_x 返回类型一致
|
|
176
|
+
return f"{error_msg}\n in {file_path}",
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def validate(file_path: Path, loader: Callable):
|
|
180
|
+
try:
|
|
181
|
+
content = file_path.read_text(encoding='utf-8')
|
|
182
|
+
loader(content)
|
|
183
|
+
return None
|
|
184
|
+
except Exception as e:
|
|
185
|
+
return format_error(e, content, file_path)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def find_files(root_path: Path, extensions: List[str]):
|
|
189
|
+
if root_path.is_dir():
|
|
190
|
+
ret = list(root_path.rglob("*"))
|
|
191
|
+
elif root_path.is_file():
|
|
192
|
+
ret = [root_path]
|
|
193
|
+
else:
|
|
194
|
+
ret = []
|
|
195
|
+
|
|
196
|
+
return [path for path in ret if path.suffix.lstrip(".").lower() in extensions]
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def load_json(content: str):
|
|
200
|
+
import json
|
|
201
|
+
json.loads(content)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def load_json5(content: str):
|
|
205
|
+
import json5
|
|
206
|
+
json5.loads(content)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def load_pyjson5(content: str):
|
|
210
|
+
import pyjson5
|
|
211
|
+
pyjson5.loads(content)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def get_cpu_count():
|
|
215
|
+
return os.cpu_count() or 1
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def main():
|
|
219
|
+
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
|
220
|
+
parser.add_argument("-p", "--path", type=Path, default=Path(".").resolve())
|
|
221
|
+
parser.add_argument(
|
|
222
|
+
"-e",
|
|
223
|
+
"--extensions",
|
|
224
|
+
type=lambda s: [ext.strip().lstrip('.').lower() for ext in re.split(r'\s*[,,]\s*', s) if ext],
|
|
225
|
+
required=True
|
|
226
|
+
)
|
|
227
|
+
parser.add_argument("-j", "--json-type", choices=list(JsonTypeEnum), default=JsonTypeEnum.JSON)
|
|
228
|
+
parser.add_argument("-n", "--worker-num", type=int, default=get_cpu_count() * 2)
|
|
229
|
+
args = parser.parse_args()
|
|
230
|
+
|
|
231
|
+
validator = JSONValidator()
|
|
232
|
+
validator.validate_files(
|
|
233
|
+
root_path=args.path,
|
|
234
|
+
extensions=args.extensions,
|
|
235
|
+
json_type=args.json_type,
|
|
236
|
+
max_workers=args.worker_num
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
if __name__ == "__main__":
|
|
241
|
+
main()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256=
|
|
1
|
+
bmcgo/__init__.py,sha256=oOiYC4HhyEc04hPvHnSvRMftVurE7Vb5YK9aRTdtk2Y,563
|
|
2
2
|
bmcgo/bmcgo.py,sha256=uD4TsfjrFB5aQPIS6WRUVc9ShXX-dSImY9ezkB13g1w,685
|
|
3
3
|
bmcgo/bmcgo_config.py,sha256=zPghH-W8vNK1bAc5PjfwnWzkHYT499PlGbhUWhPKT5U,10888
|
|
4
4
|
bmcgo/errors.py,sha256=QW1ndrJcJ2Ws7riOznPKVvZsNlrYk73eZol7w8gJTPU,3076
|
|
5
5
|
bmcgo/frame.py,sha256=iUZSd3Pj7T4yDZYX7A4DeaV9dnmJqOTjMIiJMmL9zfM,10427
|
|
6
6
|
bmcgo/logger.py,sha256=4TPOkBA80Z00rSCOdEv_WkwE5Kr3HCDt-HuVe9waXck,6645
|
|
7
|
-
bmcgo/misc.py,sha256=
|
|
7
|
+
bmcgo/misc.py,sha256=KNO1PX54UnxBpvT-4Y5BKHSSeJrmDJaWnUwVhfGquu0,4259
|
|
8
8
|
bmcgo/worker.py,sha256=-KxZIW4dziej5wCY-v5XEmtY-CDCL2-FO3VHFovlFbM,15228
|
|
9
9
|
bmcgo/cli/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
10
10
|
bmcgo/cli/cli.py,sha256=pqAkvjrk4F7x58-fYeGn0TydT3szZ2pM7guYwDoU2Ew,21520
|
|
@@ -63,7 +63,7 @@ bmcgo/codegen/lua/script/redfish_source_tree.py,sha256=HzTGY4PViZXLQLOt_U7-YMqE5
|
|
|
63
63
|
bmcgo/codegen/lua/script/sep_ipmi_message_cmds.py,sha256=dQZog5e7Eo8Z7xSrp9sUri8vg-VtEj_Sll_E_OhnBw4,8209
|
|
64
64
|
bmcgo/codegen/lua/script/template.py,sha256=kJ5vQcHKY5OKUkYrSObFjx6WLVopveasjbr0HWgrMZM,6711
|
|
65
65
|
bmcgo/codegen/lua/script/types_pb2.py,sha256=uiRP_JPK9EF57RUZuomx1K1M9_jZFZgsHXcatFrhzow,23074
|
|
66
|
-
bmcgo/codegen/lua/script/utils.py,sha256=
|
|
66
|
+
bmcgo/codegen/lua/script/utils.py,sha256=weOOTRmrBOy1IT53bHEqR0or2ElugwghdBkQs9nafE0,24583
|
|
67
67
|
bmcgo/codegen/lua/script/validate.py,sha256=_RHZBSDZklmcjETD8zRmnhz4DABzKoL-fNl1I9L4Ofs,2096
|
|
68
68
|
bmcgo/codegen/lua/script/yaml_to_json.py,sha256=31J1qJPIAJrx9Cq6bNZks3QCZ754spI5mjZNlshkcJ4,2291
|
|
69
69
|
bmcgo/codegen/lua/script/dto/__init__.py,sha256=nSBpsAbZ7UGd0a25ys_LLEpi3juPtUhVMy_tgGuZsNY,560
|
|
@@ -79,7 +79,7 @@ bmcgo/codegen/lua/script/loader/kepler_abstract_collect.py,sha256=5NIR71Bt5EPcUE
|
|
|
79
79
|
bmcgo/codegen/lua/script/loader/kepler_abstract_loader.py,sha256=wQBYQyKhBOeoUn0d1YnYFtOzWPLNZVf7QmUvjLwTMT4,1977
|
|
80
80
|
bmcgo/codegen/lua/script/loader/redfish_loader.py,sha256=k7SUKN0I4Fc6uTugeOsPP0ceRM_tVEBTbQdNl_kDav4,5944
|
|
81
81
|
bmcgo/codegen/lua/script/render_utils/__init__.py,sha256=TQLS6LwBbDdGw_nKfdfWGAP6TbaXPJ4wr_kMV2JJCS8,2014
|
|
82
|
-
bmcgo/codegen/lua/script/render_utils/client_lua.py,sha256=
|
|
82
|
+
bmcgo/codegen/lua/script/render_utils/client_lua.py,sha256=xhdLvbtH-UD2QkQggQHfTHKQvBx0HjjpQO_u5TqdMKk,3579
|
|
83
83
|
bmcgo/codegen/lua/script/render_utils/controller_lua.py,sha256=bgMXd6beOiL0Xm4rK3x09_GjaJJcDBMkt8ya0gHIqz0,2352
|
|
84
84
|
bmcgo/codegen/lua/script/render_utils/db_lua.py,sha256=SHhuoIMvN0dPplUODfvu3qCDBtgP9QmnUvjLPQEjoTk,7865
|
|
85
85
|
bmcgo/codegen/lua/script/render_utils/error_lua.py,sha256=CW9g-HPADf42zfzLSA6PW-0O_IchDKMyjztANGiIHC8,5928
|
|
@@ -100,7 +100,7 @@ bmcgo/codegen/lua/script/render_utils/validate_lua.py,sha256=NVjMWZwMxwUj9kdTaCR
|
|
|
100
100
|
bmcgo/codegen/lua/templates/Makefile,sha256=-br3qnXM_73_nJhYVgF7TsNtVxt_p_h4l5TYPjWqQIs,4044
|
|
101
101
|
bmcgo/codegen/lua/templates/errors.lua.mako,sha256=T93tESJl0K3r5izufq6NsqqCptQbVslpsTEjkQdDq0U,1536
|
|
102
102
|
bmcgo/codegen/lua/templates/messages.lua.mako,sha256=GfWjgRy0is3d-U8-Wq-i_oWguFi5d1VHQKv0pJhV9cE,1074
|
|
103
|
-
bmcgo/codegen/lua/templates/apps/Makefile,sha256=
|
|
103
|
+
bmcgo/codegen/lua/templates/apps/Makefile,sha256=RdITTL802KYOeHjBvokhejOeO976Ni1SjEf_dKvjOuc,15963
|
|
104
104
|
bmcgo/codegen/lua/templates/apps/Makefile.mdb.mk,sha256=Qmd-n_YsQbfnpED_6PIp_6pL13w6UCCGgBoBA4h6r_0,3296
|
|
105
105
|
bmcgo/codegen/lua/templates/apps/app.lua.mako,sha256=Y_aZCPyNgeqfa39_RWxV-_m3out1p4vTTWnzqXtPV7E,276
|
|
106
106
|
bmcgo/codegen/lua/templates/apps/class.lua.mako,sha256=FZsGAZeiytVwihxyyjhw6Hvv4V01Lhtz8Q9FPZYieZw,1208
|
|
@@ -154,11 +154,12 @@ bmcgo/codegen/lua/templates/new_app/test/unit/test.lua.mako,sha256=3UleW8XN8VEF7
|
|
|
154
154
|
bmcgo/codegen/lua/templates/new_app/user_conf/rootfs/etc/systemd/system/${project_name}.service.mako,sha256=b6wu4leCGtNlXJ_kmEjtJkQqIBSkYz6EfWViZGneCqY,400
|
|
155
155
|
bmcgo/codegen/lua/templates/new_app/user_conf/rootfs/etc/systemd/system/multi-user.target.wants/${project_name}.service.link,sha256=NJ6AGF9O0FGEM5dwb62LS2_KO7T3A2_lcHYFlY-KR0k,26
|
|
156
156
|
bmcgo/codegen/lua/v1/script/gen_schema.py,sha256=LtSswrIqjgk3PuGSlzKSB5Cw5OeSafYkm7PdLQ7Mrao,11717
|
|
157
|
-
bmcgo/codegen/lua/v1/script/render_utils/model_lua.py,sha256=
|
|
158
|
-
bmcgo/codegen/lua/v1/templates/apps/
|
|
159
|
-
bmcgo/codegen/lua/v1/templates/apps/
|
|
157
|
+
bmcgo/codegen/lua/v1/script/render_utils/model_lua.py,sha256=NTB1RYxjqBypm5KeRKpJSige6HtaZl_EI9mHJ5HZ9Ss,19024
|
|
158
|
+
bmcgo/codegen/lua/v1/templates/apps/client.lua.mako,sha256=9zxmgtIefq25_BJmSkaprLVMtoBgFhWVu0hB1a-vFz0,10270
|
|
159
|
+
bmcgo/codegen/lua/v1/templates/apps/model.lua.mako,sha256=EmHD62fk0QetQUO0DPz2BEc2NZmbq39pozqm4-ngYEY,2056
|
|
160
|
+
bmcgo/codegen/lua/v1/templates/apps/service.lua.mako,sha256=9LJ-G_FXNSohkAlJZ0aPLn3e4F3tWYIWDbVx6T6geWM,5648
|
|
160
161
|
bmcgo/component/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
161
|
-
bmcgo/component/build.py,sha256=
|
|
162
|
+
bmcgo/component/build.py,sha256=S0borHjBQfb0EWQ6uqKWUJGImkzHpb2x5qqz-qnzsHI,8959
|
|
162
163
|
bmcgo/component/component_dt_version_parse.py,sha256=KyrfyjbrszU-hhG1Hr6TzKuSabmGIK51b_3KuVBv5-g,14139
|
|
163
164
|
bmcgo/component/component_helper.py,sha256=k-q2uT8XbZM6BgnQMFgqtyjwTtJxmsWCMMFc2_CIyJs,6319
|
|
164
165
|
bmcgo/component/deploy.py,sha256=EO0hSZzXYPG-1SQOhNMkqLQWSeqkU3RxKemsqfWrgBE,4569
|
|
@@ -177,7 +178,7 @@ bmcgo/component/analysis/smc_dfx_whitelist.json,sha256=dy_6-FddhG6UY7D1KUCW3Vme2
|
|
|
177
178
|
bmcgo/component/analysis/sr_validation.py,sha256=i1mlJb_D7RqE510LSAcCW81K1VUmZ7oSmLiMfUgdSJI,15598
|
|
178
179
|
bmcgo/component/coverage/__init__.py,sha256=ZgUEyI86FTlOdBzcuTzz7UqTtfWcz416Gx4BCqcQlhA,557
|
|
179
180
|
bmcgo/component/coverage/c_incremental_cov_report.template,sha256=FPhK1DZtmWsjDxa32R1ViH3IGCtNHcx0zFfgRo0s2nI,1576
|
|
180
|
-
bmcgo/component/coverage/incremental_cov.py,sha256=
|
|
181
|
+
bmcgo/component/coverage/incremental_cov.py,sha256=tkeGpWfXXkipeDTEB9bS_p2S60rL_Eh0AWQbnSwHlK0,16803
|
|
181
182
|
bmcgo/component/template/conanbase.py.mako,sha256=MMZezCl5oFucRraOJt1WjmPL2S7wa4Hzfc7yDfTkW7Q,10949
|
|
182
183
|
bmcgo/component/template/conanfile.deploy.py.mako,sha256=zpxluBjUFmJHfFrnBknxZ3cv3cxcqzJuGh2eN0uMXZA,889
|
|
183
184
|
bmcgo/functional/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
@@ -185,12 +186,13 @@ bmcgo/functional/analysis.py,sha256=qjJQqd895-QmRpvges6ynwgV4w4vUYUqrMrajNUWON0,
|
|
|
185
186
|
bmcgo/functional/bmc_studio_action.py,sha256=Gg96UB8QtnhsaqSdMhXuS9fddzAFPhR6UYCpto9UOYA,3605
|
|
186
187
|
bmcgo/functional/check.py,sha256=LWoDAtEB2p65FemLEoNGz33ldtkbcJlc-uz8hwJl89U,8183
|
|
187
188
|
bmcgo/functional/conan_index_build.py,sha256=cYpv83DFnsbUJri_dKyThLo7-SDRQ4253P4Nud-HYFY,9074
|
|
188
|
-
bmcgo/functional/config.py,sha256=
|
|
189
|
+
bmcgo/functional/config.py,sha256=ZQ-a9hegI0cV41iTo7t49ryBeUH4wPJ-qkVvWp8toV4,10824
|
|
189
190
|
bmcgo/functional/csr_build.py,sha256=_1ZGYxMNOmd_52upS1RdXf1uT8rjaW1bfIw7psfkDt0,40791
|
|
190
191
|
bmcgo/functional/deploy.py,sha256=2NsxCpoZjL4jTyRpbIp20-EKKbQkQe-Hsm20uxHK2Xc,10677
|
|
191
192
|
bmcgo/functional/diff.py,sha256=WBH6aRVyVInzyvqQrmslqpItKncFbB2Z9WIBE1_O6bo,10558
|
|
192
193
|
bmcgo/functional/fetch.py,sha256=JE4iZt6a-vjuCrDg9RYDCTyLf5TvXZQvs0PgD3VBvtQ,10767
|
|
193
194
|
bmcgo/functional/full_component.py,sha256=AqVpWHtzdK-XwzE_l6vPcVNIVkAzyE2X5nqSkgsdvhA,16277
|
|
195
|
+
bmcgo/functional/json_check.py,sha256=ACoABAV1YfrrR98-G_0sX5i5lFHRjl00GspmKRdUFz8,3473
|
|
194
196
|
bmcgo/functional/maintain.py,sha256=8bUwaCsZAiBWDrf8NsdVoOvyMY2JOoXdzvahU9Hd8-0,17951
|
|
195
197
|
bmcgo/functional/new.py,sha256=A4--cy3R-moFD8KtrGGIzMiVVwnB2rL8qlrJz1dGGMg,6157
|
|
196
198
|
bmcgo/functional/schema_valid.py,sha256=jk4blLZgQCJv4eOY0YK2Fy0oRCdG1sfSssd2rGT-Eoc,3910
|
|
@@ -211,7 +213,7 @@ bmcgo/tasks/download_buildtools_hm.py,sha256=f4UxStARc8Z8DnT_5O6ONajQ7P0sKyJ8bri
|
|
|
211
213
|
bmcgo/tasks/misc.py,sha256=GK_bSDLGZW0FxywB2ICG1iIEz2y2QoCb1YQQk8SYOIA,711
|
|
212
214
|
bmcgo/tasks/task.py,sha256=n7EhquD3FQeT8LHk0tREKOG9t1BcbMge_TY6ekGFydk,17064
|
|
213
215
|
bmcgo/tasks/task_build_conan.py,sha256=nQt4VyK4QHh2u4JbM8kfK9WBVIMGKI18S2NPg9orlvQ,32962
|
|
214
|
-
bmcgo/tasks/task_build_rootfs_img.py,sha256=
|
|
216
|
+
bmcgo/tasks/task_build_rootfs_img.py,sha256=0SF_3EAA1SNY1s7YyMBadHrJTp7A2mBD0r3te-231wQ,30456
|
|
215
217
|
bmcgo/tasks/task_build_wbd_up.py,sha256=X9-0Qqad-s3mGfJBMeBQvfZ99KlWcgaMluDr_zv6Z-o,3122
|
|
216
218
|
bmcgo/tasks/task_buildgppbin.py,sha256=Xjfw6j8OsyS_XRiOt4vqIK1rDQ4sNKG__eurDu-M9bo,6341
|
|
217
219
|
bmcgo/tasks/task_buildhpm_ext4.py,sha256=DBZnmU_eb14J0CW_wVoCc9VKnssFF1vXmRhLJQ6kR28,3482
|
|
@@ -223,6 +225,7 @@ bmcgo/tasks/task_packet_to_supporte.py,sha256=eaNtri3YQfXFBnceM1-2C_6AgMgrGxEj4x
|
|
|
223
225
|
bmcgo/tasks/task_prepare.py,sha256=vKHb5QPbIx0lHOGpcDjeAB7rMfERqMUCad2EzxLauBw,4534
|
|
224
226
|
bmcgo/tasks/task_sign_and_pack_hpm.py,sha256=X8m1WAj3c0bKi2JAaumR81Qxv1FnFi0SrRL-l6vDRAo,1965
|
|
225
227
|
bmcgo/utils/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
228
|
+
bmcgo/utils/basic_enums.py,sha256=L5VtHtzSvs6duAnphgqDGXX80Wit3Y7DjMlpi9MCxyI,1348
|
|
226
229
|
bmcgo/utils/buffer.py,sha256=t1SkWntWksboNFMPsltslwRdXZi3FAe8eV0JAAE7Vto,4004
|
|
227
230
|
bmcgo/utils/combine_json_schemas.py,sha256=08JrAlLeo_JgUqzYcZNgSwJZPLfjbWVJ4esPPt9bPMY,7967
|
|
228
231
|
bmcgo/utils/component_post.py,sha256=b2sr2IVensmnvcB7VcbIHkzCtS-fbtjPb4k1LiNReQk,2296
|
|
@@ -230,6 +233,7 @@ bmcgo/utils/component_version_check.py,sha256=ZhY3LUgmvuoDTlSjyFeh2blmcYbFcwtijN
|
|
|
230
233
|
bmcgo/utils/config.py,sha256=P3cqV0wlMn5U8NApUD7JKIuMVKqARtNfxsKopDn-rv4,48484
|
|
231
234
|
bmcgo/utils/fetch_component_code.py,sha256=vH9rY2YcXK5tBUEK7fLmKVxK9cYDM39FHmManBQA2KQ,10011
|
|
232
235
|
bmcgo/utils/install_manager.py,sha256=XMZUuIHm7_DWRdLV4dAevsyamQ6rt8lb_7OqGWzNBC8,4927
|
|
236
|
+
bmcgo/utils/json_validator.py,sha256=_k5wU78wfYGrzvSDaqOEtT4otgKUjquVhZNpVf2PW_c,7524
|
|
233
237
|
bmcgo/utils/mapping_config_patch.py,sha256=_gKfZnrvsLPgHn1yXhEJRVTAeuGpeGD9T-Pqyw5Ydys,16827
|
|
234
238
|
bmcgo/utils/perf_analysis.py,sha256=fh6lV9AAKVhpPkGPwAJ8EWfGfUoHjqGYQxrvc32Xiac,4767
|
|
235
239
|
bmcgo/utils/tools.py,sha256=fLKBz_FiNc0s8UBkXQ_TZrzldCYLGEH8ZuqLUgS9g30,28849
|
|
@@ -242,8 +246,8 @@ bmcgo/utils/installations/version_util.py,sha256=dOwvLZ7iOmnzSeyD6_pRm7NS7I13Um5
|
|
|
242
246
|
bmcgo/utils/installations/install_plans/bingo.yml,sha256=Zw1HnAyNJdEwkE3fnd-_GCe9bwv1m6bmMlaQTJXaFa8,210
|
|
243
247
|
bmcgo/utils/installations/installers/apt_installer.py,sha256=nPaCb4cobSi9InN_aHsEPtQ0k4FgsCUWE5_VgBPvcRE,3769
|
|
244
248
|
bmcgo/utils/installations/installers/pip_installer.py,sha256=dDdios1EQ7fzt90r02pZeoM3jCmjslLzkSvzd2hgRVM,3241
|
|
245
|
-
openubmc_bingo-0.5.
|
|
246
|
-
openubmc_bingo-0.5.
|
|
247
|
-
openubmc_bingo-0.5.
|
|
248
|
-
openubmc_bingo-0.5.
|
|
249
|
-
openubmc_bingo-0.5.
|
|
249
|
+
openubmc_bingo-0.5.257.dist-info/METADATA,sha256=pBgExKV-sTCM87lJyeEWK-2F7YEf0s4NAZGlVBFGBR0,925
|
|
250
|
+
openubmc_bingo-0.5.257.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
251
|
+
openubmc_bingo-0.5.257.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
252
|
+
openubmc_bingo-0.5.257.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
253
|
+
openubmc_bingo-0.5.257.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|