The-Nazara-Project / Nazara

A CLI application to create and update machines and VMs in Netbox.
GNU General Public License v3.0
11 stars 2 forks source link

[BUG:] Thread panicked when config parameter not found. #37

Open ByteOtter opened 12 months ago

ByteOtter commented 12 months ago

Found an issue? Please let us know!

When loading the config file it appears that this block panickes when a config parameter cannot be found.

        let config_parameters: ConfigData = ConfigData {
            netbox_api_token: config_contents["netbox"]["netbox_uri"]
                .as_str()
                .unwrap()
                .trim()
                .to_string(),
            netbox_uri: config_contents["netbox"]["netbox_api_token"]
                .as_str()
                .unwrap()
                .trim()
                .to_string(),
            system_location: config_contents["system"]["system_location"]
                .as_str()
                .unwrap()
                .trim()
                .to_string(),
        };

Please tick the applicable box(es) regarding the kind of bug you found: