CiscoDevNet/python-viptela

.lower() missing in policy_updates

robertcsapo opened this issue · 1 comments

def update_policy_definition(self, policy_type, name, policy_id, policy_def, new_color, seq_name=None):

"type": policy_def["type"],

Issue

policy.update_policy_definition(
    policy_type=policy_voice_video["type"],
    name=policy_voice_video["name"],
    policy_id=policy_voice_video["definitionId"],
    new_color="mpls",
    policy_def=policy_voice_video,
)

Exception: https://10.10.20.90:443/dataservice/template/policy/definition/appRoute/59e41e53-c2b3-4c57-993d-6a9411e3a17d: Error 404 (not_found)

appRoute comes from the API payload, but should be lower cases.

Workaround

policy.update_policy_definition(
    policy_type=policy_voice_video["type"].lower(),
    name=policy_voice_video["name"],
    policy_id=policy_voice_video["definitionId"],
    new_color="mpls",
    policy_def=policy_voice_video,
)
Master templates affected: ['90f26d2d-8136-4414-84de-4e8df52374e6']
Updated Voice_Video App Route policy successfully

Merged in #115