'Update nova flavor.'

def handle_update(self, json_snippet, tmpl_diff, prop_diff):

    if (self.EXTRA_SPECS in prop_diff):
        flavor = self.client().flavors.get(self.resource_id)
        old_keys = flavor.get_keys()
        flavor.unset_keys(old_keys)
        new_keys = prop_diff.get(self.EXTRA_SPECS)
        if (new_keys is not None):
            flavor.set_keys(new_keys)
    'Update    tenant    access    list.'
    if ((self.TENANTS in prop_diff) and (not self.IS_PUBLIC)):
        kwargs = {'flavor': self.resource_id}
        old_tenants = ([x.tenant_id for x in self.client().flavor_access.list(**kwargs)] or [])
        new_tenants = (prop_diff.get(self.TENANTS) or [])
        tenants_to_remove = list((set(old_tenants) - set(new_tenants)))
        tenants_to_add = list((set(new_tenants) - set(old_tenants)))
        if (tenants_to_remove or tenants_to_add):
            flavor = self.client().flavors.get(self.resource_id)
            for _tenant in tenants_to_remove:
                self.client().flavor_access.remove_tenant_access(flavor, _tenant)
            for _tenant in tenants_to_add:
                self.client().flavor_access.add_tenant_access(flavor, _tenant)
