Hi everyone,
I was struggling to get FortiOS config in YAML format into Python.
Thanks to this post I found out it's a bug - 976722.
System configuration export in YAML seems invalid - Fortinet Community
Fortinet fixed the bug in 7.4.8. I updated a device to 7.4.8 and downloaded the config in YAML format.
I can now load the config into Python, but I'm facing a new challenge. The object that is created from the file is a Python dictionary with two keys: 'global' and 'vdom'. This is expected. When I select key 'vdom' and load it into its own object, its data type is list. This is where the problem is. The list contains only one of two VDOMs I have in my config. The YAML file contains both VDOMs.
Did anyone encounter the same issue? Any idea how to proceed?
For questions related to scripting and programming, you can reach out to Fortinet Developer Network.
You can find multiple answers that might also help you with your task.
User | Count |
---|---|
2593 | |
1382 | |
800 | |
659 | |
455 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.