DiegoSanjuan / pysphere

Automatically exported from code.google.com/p/pysphere
0 stars 0 forks source link

duplicated snapshots list #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. vm = server.get_vm_by_name('some-existing-vm')
2. len(vm.get_snapshots()) # f.i 3
3. vm.refresh_snapshot_list()
4. len(vm.get_snapshots()) # 6 - duplicated

worse case (my case :) ):
1. vm = server.get_vm_by_name('some-existing-vm') # vm has 4 snapshots
2. vm.create_snapshot('12/12/2011') # snapshot will be 'refreshed' transparently
3. # now i'm removing snapshots over KEEP_OLD_SNAPSHOTS=4
4. i lost all my snapshots in that keys instead of oldest one

What is the expected output? What do you see instead?
 * snapshots list should be cleared and next filled with current state

What version of the product are you using? On what operating system?
 * pysphere 0.1.5
 * python 2.6
 * debian squeeze

Please provide any additional information below.

in file 
http://code.google.com/p/pysphere/source/browse/trunk/pysphere/vi_virtual_machin
e.py at line 1430:
 * snapshots are appended into self._root_snapshots
 * but self._root_snapshots is only cleared while creating new VIVirtualMachine in __init__
 * i think it should by cleared before "for root_snap in self.properties.snapshot.rootSnapshotList:
"

Original issue reported on code.google.com by marek.wy...@i-dotcom.pl on 20 Dec 2011 at 12:57

GoogleCodeExporter commented 8 years ago
I've just seen this issue report. (I though google would send me an email when 
somebody reports an issue but apparently it didn't). Thanks for the detailed 
information, I'll be looking at it.

Original comment by argo...@gmail.com on 20 Jan 2012 at 6:58

GoogleCodeExporter commented 8 years ago
fixed in r51

self._root_snapshot is cleared every time before filling the list.

Original comment by argo...@gmail.com on 20 Jan 2012 at 7:14

GoogleCodeExporter commented 8 years ago
thanks for fix, and your great job on pysphere :)

Original comment by marek.wy...@i-dotcom.pl on 23 Jan 2012 at 7:12