CiscoDevNet / python-viptela

Cisco Viptela vManage Python CLI/SDK
GNU General Public License v3.0
96 stars 64 forks source link

add_device_template error, wrong payload #171

Open ernestoherrerab opened 2 years ago

ernestoherrerab commented 2 years ago

The payload is declared as follows:

        payload = {
            'templateName': device_template['templateName'],
            'templateDescription': device_template['templateDescription'],
            'deviceType': device_template['deviceType'],
            'factoryDefault': device_template['factoryDefault'],
            'configType': device_template['configType'],
            'featureTemplateUidRange': []
        }

However there is no reference to the key 'featureTemplateUidRange' and instead the following is used:

payload['generalTemplates']

in the condition:

else:
            payload['generalTemplates'] = device_template['generalTemplates']

However, in the payload there is no mention of ['generalTemplates']

Can this be fixed in the next iteration?

Thank you

ernestoherrerab commented 2 years ago

I added the following to get it to work:

        payload = {
            'templateName': device_template['templateName'],
            'templateDescription': device_template['templateDescription'],
            'deviceType': device_template['deviceType'],
            'factoryDefault': device_template['factoryDefault'],
            'configType': device_template['configType'],
            'featureTemplateUidRange': [],
            'generalTemplates': device_template['generalTemplates']
        }