empty namespaces still return values
DawidKrysiak opened this issue · comments
Not a big issue, but I wonder if anyone has a quick solution for it.
I am using this script to generate an inventory for documentation purposes (I save nicely formatted yaml files rather than jsons). I wish to achieve two things
- avoid adding empty sections as per below - is there a way to omit those?
ec2: []
ec2-ebs: []
ec2-egpu: []
ec2-eips: []
- only return specific fields from an inventory. e.g:
for EvenBus, I only need 'Name', not a whole blob of 17 lines.
Kind regards
Dawid
Hi, sorry, I'm a bit busy these days. Omitting empty sections could be a good idea, but sometimes this empty result is what you are looking for. So we can add a parameter for this usage, but I don't if the best location for this it's in the script. For selecting fields, it's really more difficult because the field names are not really standardized: you'll have to know exactly what you want for every service you will call. If you want this feature, you'll need to have a very long parameters list. Here I'm sure that this filtering should be made outside the script, but it could be a good idea to add Python scripts to format the raw output.