Advertisement
Guest User

Untitled

a guest
Feb 25th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
  2. index d78cb50..875d00e 100644
  3. --- a/nova/db/sqlalchemy/api.py
  4. +++ b/nova/db/sqlalchemy/api.py
  5. @@ -818,6 +818,20 @@ def compute_node_update(context, compute_id, values):
  6. # scheduler cache of compute node data in case of races.
  7. values['updated_at'] = timeutils.utcnow()
  8. convert_objects_related_datetimes(values)
  9. +
  10. + # We need to return the augmented compute_ref we queried
  11. + # above because it has all the inventory junk in it,
  12. + # so we have to pick the model and do the update of both
  13. + # manually here.
  14. + compute = models.ComputeNode()
  15. + compute.id = compute_id
  16. +
  17. + # This should not be necessary
  18. + #compute.update({k: v for k, v in compute_ref.items()
  19. + # if hasattr(compute, k)})
  20. +
  21. + compute.update(values)
  22. + compute.save(context.session) # <- tries to INSERT
  23. compute_ref.update(values)
  24.  
  25. return compute_ref
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement