Free Form Example in README is not accurate
jamesdreid opened this issue · comments
jamesdreid commented
The code sample in the README file used to demonstrate the operation of the free form method does not include a reference the variable defined in the "for" loop in the f-string. The sample code:
multi_data = []
for pol_id in [1, 3, 4, 5, 7]:
multi_data.append({
"url": f"/pm/config/adom/root/pkg/default/firewall/policy/",
"fields": ["policyid", "name"],
})
if len(multi_data) > 0:
code, res = fmg_instance.free_form("get", data=multi_data)
Should probably read:
multi_data = []
for pol_id in [1, 3, 4, 5, 7]:
multi_data.append({
"url": f"/pm/config/adom/root/pkg/default/firewall/policy/{pol_id}",
"fields": ["policyid", "name"],
})
if len(multi_data) > 0:
code, res = fmg_instance.free_form("get", data=multi_data)
jamesdreid commented
Will be including a fix for this in a PR shortly but it will be submitted with a fix for the other free form response data issue #19
jamesdreid commented
Fix merged in #20