cvprac icon indicating copy to clipboard operation
cvprac copied to clipboard

add_users_from_csv_cvaas.py only works with default group

Open philippebureau opened this issue 2 years ago • 2 comments

User creation works with default groups (network-admin, network-operator...) but not work user created roles

This is the error : POST: https://www.cv-prod-na-northeast1-b.arista.io:443/cvpservice/user/addUser.do : Request Error: Failure - Unable to add new entity

philippebureau avatar Jul 26 '22 17:07 philippebureau

That's because the addUser.do expects role IDs, the default roles have the same name as their role IDs, whereas user created roles have role_<unixtime> as their ID. On cvprac side we could fix this by running /role/getRoles.do to fetch all roles and swap the name with the id in the call, ie validate if the name the user has input is a roleId or not, and if not push the roleID. Would that help?

noredistribution avatar Jul 26 '22 19:07 noredistribution

On cvprac side we could fix this by running /role/getRoles.do to fetch all roles and swap the name with the id in the call, ie validate if the name the user has input is a roleId or not, and if not push the roleID. Would that help?

That would help yes

philippebureau avatar Jul 26 '22 19:07 philippebureau