tools: Fix datatypes in generated json

This commit is contained in:
Vivek Kumar Dutta 2024-11-27 12:21:15 +00:00 committed by IOPSYS Dev
parent cc92e81aea
commit dea555173f
No known key found for this signature in database
4 changed files with 78 additions and 75 deletions

View file

@ -360,8 +360,8 @@ def download_and_build_plugins(plugins, vendor_prefix):
name=os.path.basename(repo).replace('.git','') name=os.path.basename(repo).replace('.git','')
if repo is None or proto is None or dm_files is None or not isinstance(dm_files, list): if repo is None or proto is None or dm_files is None or not isinstance(dm_files, list):
print("Necessary input missing")
BBF_ERROR_CODE += 1 BBF_ERROR_CODE += 1
print(f"# Necessary input missing {BBF_ERROR_CODE}")
continue continue
print(f' - Processing plugin: MS({is_microservice}) {plugin}') print(f' - Processing plugin: MS({is_microservice}) {plugin}')
@ -372,8 +372,8 @@ def download_and_build_plugins(plugins, vendor_prefix):
if not clone_git_repository(repo, version): if not clone_git_repository(repo, version):
print(f"Failed to clone {repo}")
BBF_ERROR_CODE += 1 BBF_ERROR_CODE += 1
print(f"# Failed to clone {repo} {BBF_ERROR_CODE}")
continue continue
print(f' Processing {get_repo_version_info(repo, version)}') print(f' Processing {get_repo_version_info(repo, version)}')
@ -382,8 +382,8 @@ def download_and_build_plugins(plugins, vendor_prefix):
print(f' Processing {get_repo_version_info(repo, proto)}') print(f' Processing {get_repo_version_info(repo, proto)}')
if repo_path is None: if repo_path is None:
print("Repository path not defined!!!")
BBF_ERROR_CODE += 1 BBF_ERROR_CODE += 1
print(f"# Repository path not defined {BBF_ERROR_CODE}!!!")
continue continue
create_folder("/tmp/repo/dm_info") create_folder("/tmp/repo/dm_info")
@ -404,20 +404,21 @@ def download_and_build_plugins(plugins, vendor_prefix):
elif filename.endswith('.json'): elif filename.endswith('.json'):
move_file(filename, "/usr/share/bbfdm/plugins") move_file(filename, "/usr/share/bbfdm/plugins")
else: else:
print(f"Unknown file format {filename}")
BBF_ERROR_CODE += 1 BBF_ERROR_CODE += 1
print(f"# Unknown file format {filename} {BBF_ERROR_CODE}")
else: else:
print(f"Error: File not accessible {filename} !!!!!!")
BBF_ERROR_CODE += 1 BBF_ERROR_CODE += 1
print(f"# Error: File not accessible {filename} {BBF_ERROR_CODE}!!!!!!")
if len(LIST_FILES) > 0: if len(LIST_FILES) > 0:
if not generate_shared_library(f"{plugin_index}_{name}.so", LIST_FILES, vendor_prefix, extra_dependencies, is_microservice): if not generate_shared_library(f"{plugin_index}_{name}.so", LIST_FILES, vendor_prefix, extra_dependencies, is_microservice):
BBF_ERROR_CODE += 1 BBF_ERROR_CODE += 1
print(f"# Error: Failed to generate shared library for {plugin_index}_{name}, error {BBF_ERROR_CODE}")
clear_list(LIST_FILES) clear_list(LIST_FILES)
cd_dir(CURRENT_PATH) cd_dir(CURRENT_PATH)
print('Generating plugins completed.') print(f'Generating plugins completed, error {BBF_ERROR_CODE}')
def generate_supported_dm(vendor_prefix=None, plugins=None): def generate_supported_dm(vendor_prefix=None, plugins=None):

View file

@ -69,7 +69,7 @@ def getparamtype(dmparam):
break break
if c.tag == "dataType": if c.tag == "dataType":
reftype = c.get("ref") reftype = c.get("ref")
if reftype == "StatsCounter32" or reftype == "PSDBreakPointIndexAndLevel" or reftype == "PSMBreakPointIndexAndLevel" or reftype == "SELTPAttenuationCharacteristicsIndexAndTFlog": if reftype == "StatsCounter32" or reftype == "PSDBreakPointIndexAndLevel" or reftype == "PSMBreakPointIndexAndLevel" or reftype == "SELTPAttenuationCharacteristicsIndexAndTFlog" or reftype == "Order":
ptype = "unsignedInt" ptype = "unsignedInt"
break break
elif reftype == "StatsCounter64": elif reftype == "StatsCounter64":
@ -453,7 +453,10 @@ def add_param_to_list(main_obj, dmobject, dmparam, proto):
def add_command_to_list(main_obj, dmparam, proto): def add_command_to_list(main_obj, dmparam, proto):
is_async = dmparam.get('async') is not None is_async = False
if dmparam.get('async') == "true":
is_async = True
entry_command = { entry_command = {
"name": main_obj + dmparam.get('name'), "name": main_obj + dmparam.get('name'),

View file

@ -60,7 +60,7 @@
}, },
"Reboot()": { "Reboot()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -158,7 +158,7 @@
}, },
"FactoryReset()": { "FactoryReset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -24340,7 +24340,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -28632,7 +28632,7 @@
}, },
"PasswordReset()": { "PasswordReset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -28672,7 +28672,7 @@
"datatype": "_AliasCWMP" "datatype": "_AliasCWMP"
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -28931,7 +28931,7 @@
}, },
"CreateWebSession()": { "CreateWebSession()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -29089,7 +29089,7 @@
}, },
"Delete()": { "Delete()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -37202,7 +37202,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -38436,7 +38436,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -41751,7 +41751,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -42135,7 +42135,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -42474,7 +42474,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -42788,7 +42788,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -43151,7 +43151,7 @@
}, },
"SendMagicPacket()": { "SendMagicPacket()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -43814,7 +43814,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -53965,7 +53965,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -70045,7 +70045,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -74774,7 +74774,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -75908,7 +75908,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -76679,7 +76679,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -76986,7 +76986,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -84908,7 +84908,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -86897,7 +86897,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -87656,7 +87656,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -88349,7 +88349,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -90339,7 +90339,7 @@
}, },
"StatsReset()": { "StatsReset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -91176,7 +91176,7 @@
}, },
"MACTest()": { "MACTest()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -92713,7 +92713,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -96664,7 +96664,7 @@
}, },
"FlushCache()": { "FlushCache()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -99865,7 +99865,7 @@
}, },
"Renew()": { "Renew()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -99967,7 +99967,7 @@
"datatype": "boolean" "datatype": "boolean"
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -100216,7 +100216,7 @@
"datatype": "_AliasCWMP" "datatype": "_AliasCWMP"
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -101037,7 +101037,7 @@
"datatype": "_AliasCWMP" "datatype": "_AliasCWMP"
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -101505,7 +101505,7 @@
}, },
"Renew()": { "Renew()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -102143,7 +102143,7 @@
"datatype": "_AliasCWMP" "datatype": "_AliasCWMP"
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -102984,14 +102984,14 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
}, },
"Disconnect()": { "Disconnect()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -103190,7 +103190,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -103378,7 +103378,7 @@
}, },
"CheckCredentialsDiagnostics()": { "CheckCredentialsDiagnostics()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -104002,7 +104002,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -105713,7 +105713,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -106081,7 +106081,7 @@
] ]
}, },
"Order": { "Order": {
"type": "string", "type": "unsignedInt",
"read": true, "read": true,
"write": true, "write": true,
"protocols": [ "protocols": [
@ -108215,14 +108215,14 @@
}, },
"ForceSample()": { "ForceSample()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
}, },
"ForceCollection()": { "ForceCollection()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -109646,7 +109646,7 @@
}, },
"GPSReset()": { "GPSReset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -111709,7 +111709,7 @@
}, },
"ForceCollection()": { "ForceCollection()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -112720,7 +112720,7 @@
}, },
"AddExecEnv()": { "AddExecEnv()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -113401,7 +113401,7 @@
}, },
"SetRunLevel()": { "SetRunLevel()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -113793,7 +113793,7 @@
}, },
"Remove()": { "Remove()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -114762,7 +114762,7 @@
}, },
"SetRequestedState()": { "SetRequestedState()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -114786,7 +114786,7 @@
}, },
"Restart()": { "Restart()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -118479,7 +118479,7 @@
}, },
"ForceReconnect()": { "ForceReconnect()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -119224,7 +119224,7 @@
}, },
"ForceReconnect()": { "ForceReconnect()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -126763,7 +126763,7 @@
}, },
"Delete()": { "Delete()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -131509,7 +131509,7 @@
}, },
"AddCertificate()": { "AddCertificate()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -132254,7 +132254,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -132471,7 +132471,7 @@
}, },
"ScheduleTimer()": { "ScheduleTimer()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -132525,7 +132525,7 @@
}, },
"AddMyCertificate()": { "AddMyCertificate()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -132565,7 +132565,7 @@
}, },
"SendOnBoardRequest()": { "SendOnBoardRequest()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -132910,7 +132910,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -133285,7 +133285,7 @@
}, },
"Reset()": { "Reset()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
@ -133357,14 +133357,14 @@
}, },
"Delete()": { "Delete()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]
}, },
"GetFingerprint()": { "GetFingerprint()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -133475,7 +133475,7 @@
}, },
"RequestChallenge()": { "RequestChallenge()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -133583,7 +133583,7 @@
}, },
"ChallengeResponse()": { "ChallengeResponse()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
], ],
@ -134264,7 +134264,7 @@
}, },
"Cancel()": { "Cancel()": {
"type": "command", "type": "command",
"async": true, "async": false,
"protocols": [ "protocols": [
"usp" "usp"
] ]

View file

@ -103,7 +103,6 @@
"proto": "git", "proto": "git",
"version": "devel", "version": "devel",
"dm_files": [ "dm_files": [
"urlfilter/files/etc/urlfilter/X_IOPSYS_EU_ParentalControl.json",
"icwmp/files/etc/bbfdm/json/CWMPManagementServer.json", "icwmp/files/etc/bbfdm/json/CWMPManagementServer.json",
"ponmngr/files/etc/ponmngr/xpon.json" "ponmngr/files/etc/ponmngr/xpon.json"
] ]