aristanetworks/cvprac

validate_configlet returns a boolean instead of a dict result

dbm79 opened this issue · 3 comments

dbm79 commented

The docstring for this method indicate a response (dict) will be returned but a boolean is returned instead. The response dict is useful in my opinion. I will change and put in a pull request to be merged if desired.

def validate_config(self, device_mac, config): ''' Validate a config against a device Args: device_mac (str): Device MAC address config (str): Switch config statements Returns: response (dict): A dict that contains the result of the validation operation '''

I think the solution here is to change to doc string for validate_config. More details in the associated PR #171

dbm79 commented

I 100% agree with you. I will cancel PR #171 and adjust the docstring if you want me to. I will also look at adding a separate function to return a dict of the validation results.

I think the solution here is to change to doc string for validate_config. More details in the associated PR #171

@dbm79 I can adjust the docstring and add the new function making validate_config a wrapper around the new function that will return the full dict. I'll tag you in the PR so you can have a look and confirm it will help your use case before I merge.