cinder list shows multiple duplicate copies of each volume

This is due to get_local_volumes api changed from community, it always
cannot get local volume from db(empty list []), so driver attempts
to insert new volumes every time restarted or periodically sync.

Change-Id: I225394bfaff2229dbb93caa69e067154c608c15a
Closes-Bug: 1435121
(cherry picked from commit 516eba24a7)
This commit is contained in:
Jerry Cai 2015-03-23 11:13:17 +08:00
parent 148c8822e5
commit 86b4c4ee2d
1 changed files with 2 additions and 2 deletions

View File

@ -816,8 +816,8 @@ class PowerVCCinderManager(service.Service):
db_matches = db.volume_get_all(context,
marker=None,
limit=None,
sort_key='created_at',
sort_dir='desc')
sort_keys=['created_at'],
sort_dirs=['desc'])
for local_volume in db_matches:
if self._get_pvc_id_from_local_volume(local_volume)is not None:
local_pvc_volumes.append(local_volume)