Hi Gomathi. I've finally got back to this! when I run cli_rm_builder 
against the existing vyos.firewall_rules module (or my modified version), 
it fails with an error. The problem is when 
'convert_doc_to_ansible_module_kwargs' calls 'extract_argspec(doc_obj, 
argpsec)', 'extract_argspec' tries to access the 'options' key, which 
doesn't exist. 'doc_obj' contains a dictionary which has the 
'DOCUMENTATION' key at its top level. The value of the 'DOCUMENTATION' key 
is a string containing the doc yaml. If I replace the 'extract_argspec' 
function with a version starting with the following (ie. decoding the 
'DOCUMENTATION' string), and modify 'convert_doc_to_ansible_module_kwargs' 
to call this version, it seems to work:

    def extract_argspecX(doc_obj, argpsec):
        d_obj = yaml.load(doc_obj['DOCUMENTATION'], SafeLoader)
        options_obj = d_obj.get("options")
                    ...

So my question is, is this a bug in CLI_RM_BUILDER, or could it be 
something in the way that I'm calling it that is causing it to fail?

Thanks for your time...

On Wednesday, August 25, 2021 at 1:01:19 AM UTC+10 gosr...@redhat.com wrote:

> Hi,
>
> CLI_RM_BUILDER is the right tool to use to build a model or add keys or 
> delete keys. 
> Please refer to this doc 
> <https://github.com/ansible-network/cli_rm_builder/pull/21/files>. The 
> documentation work for cli_rm_builder tool is still in progress. 
> Let me know if anything is not clear with respect to cli_rm_builder tool 
> usage.
>
> Thanks,
> Gomathi
>
> On Friday, August 20, 2021 at 11:23:49 PM UTC-4 David Moreau Simard wrote:
>
>> Hi o/
>>
>> I do not have the answer but will ask around.
>>
>> In the meantime, looking at the existing (or closed!) PRs for the 
>> collection might help understanding how it works ?
>> Let us know if you find the answer.
>>
>> [1]: https://github.com/ansible-collections/vyos.vyos/pulls
>>
>> On Thursday, August 19, 2021 at 11:27:40 PM UTC-4 pigriffin wrote:
>>
>>> Hi all. I haven't submitted to ansible before and need a bit of guidance 
>>> if anyone's got time!
>>> My actual change is to add a single parameter in the vyos.vyos 
>>> collection, and is only a few lines. But to get to the point, for updates 
>>> to the vyos.vyos collection:
>>>
>>> 1. should I use 'Resource module builder' or CLI_RM_BUILDER; and
>>> 2. If it's CLI_RM_BUILDER, does it still use the models repository, or 
>>> something else?
>>>
>>> Thanks for your time.
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/d1bf03f5-16aa-49b2-ab01-9baa70e57976n%40googlegroups.com.

Reply via email to