Can you just move this code after the code setting keystone_instance? That would make the same order as the one used in the json/schema to define the attributes.