f5devcentral / f5-corkscrew

TMOS parser and application extractor
Apache License 2.0
14 stars 3 forks source link

[bug] config with no apps errors #19

Closed DumpySquare closed 2 years ago

DumpySquare commented 3 years ago

If the config does not have any apps, the process fails with a runtime error.

This should not cause a run time error, but continue and let the user know.

this will allow for other things like testing and extracting base configs for DO.

DumpySquare commented 3 years ago

debug log, don't try to loop through an empty array....

ltm.ts, line 537 in the "apps" function

[2021-05-24T20:31:55.696Z] INFO: f5.cfgExplore, parsing file -> config/filestore/files_d/Common_d/certificate_key_d/:Common:f5_api_com.key_62544_1 [2021-05-24T20:31:55.696Z] INFO: f5.cfgExplore, extracting apps [2021-05-24T20:31:55.697Z] INFO: f5.cfgExplore, parsing file -> [object Object] [2021-05-24T20:31:55.697Z] INFO: f5.cfgExplore, parsing file -> [object Object] [2021-05-24T20:31:55.698Z] INFO: f5.cfgExplore, parsing file -> [object Object] [2021-05-24T20:31:55.699Z] INFO: f5.cfgExplore, parsing file -> [object Object] [2021-05-24T20:31:55.699Z] INFO: f5.cfgExplore, parsing file -> [object Object] [2021-05-24T20:31:55.700Z] ERROR: makeExplosion [TypeError: Cannot convert undefined or null to object at Function.entries () at BigipConfig. (c:\Users\bgordon.vscode\extensions\f5devcentral.vscode-f5-3.0.1\node_modules\f5-corkscrew\dist\ltm.js:442:51) at Generator.next () at c:\Users\bgordon.vscode\extensions\f5devcentral.vscode-f5-3.0.1\node_modules\f5-corkscrew\dist\ltm.js:16:71 at new Promise () at __awaiter (c:\Users\bgordon.vscode\extensions\f5devcentral.vscode-f5-3.0.1\node_modules\f5-corkscrew\dist\ltm.js:12:12) at BigipConfig.apps (c:\Users\bgordon.vscode\extensions\f5devcentral.vscode-f5-3.0.1\node_modules\f5-corkscrew\dist\ltm.js:419:16) at BigipConfig. (c:\Users\bgordon.vscode\extensions\f5devcentral.vscode-f5-3.0.1\node_modules\f5-corkscrew\dist\ltm.js:379:37) at Generator.next () at fulfilled (c:\Users\bgordon.vscode\extensions\f5devcentral.vscode-f5-3.0.1\node_modules\f5-corkscrew\dist\ltm.js:13:58) at processTicksAndRejections (internal/process/task_queues.js:93:5)]