From e151aecab2dfd1ff37a01e38e1232a170bd5a13b Mon Sep 17 00:00:00 2001
From: Eric Harney <eharney@redhat.com>
Date: Thu, 19 Nov 2015 15:01:25 -0500
Subject: [PATCH] Manage existing: fix volume object saving

This needs an update to work with volume objects.

Currently, manage existing can fail here.

Change-Id: I9197220be201cbbb1cd8266ebb58b57641fc216f
Closes-Bug: #1518050
---
 cinder/volume/flows/manager/manage_existing.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cinder/volume/flows/manager/manage_existing.py b/cinder/volume/flows/manager/manage_existing.py
index dcbd8ae3735..9d2ac1886dc 100644
--- a/cinder/volume/flows/manager/manage_existing.py
+++ b/cinder/volume/flows/manager/manage_existing.py
@@ -79,8 +79,8 @@ class ManageExistingTask(flow_utils.CinderTask):
             model_update = {}
         model_update.update({'size': size})
         try:
-            volume_ref = self.db.volume_update(context, volume_ref['id'],
-                                               model_update)
+            volume_ref.update(model_update)
+            volume_ref.save()
         except exception.CinderException:
             LOG.exception(_LE("Failed updating model of volume %(volume_id)s"
                               " with creation provided model %(model)s") %