Change in vdsm[ovirt-3.3]: gluster: correct parameter for creating hookpath in verb hoo...
by dnarayan@redhat.com
Hello Bala.FA, Aravinda VK, Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/21538
to review the following change.
Change subject: gluster: correct parameter for creating hookpath in verb hookAdd.
......................................................................
gluster: correct parameter for creating hookpath in verb hookAdd.
parameter hookLevel must be in lower case for creating correct
path for hook. so that parameter is changed to lower case.
Change-Id: Ic16885a7f837ccceede2cf1b70b5da3138a12a60
https://bugzilla.redhat.com/show_bug.cgi?id=1028972
Signed-off-by: ndarshan <dnarayan(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21017
Reviewed-by: Aravinda VK <avishwan(a)redhat.com>
Reviewed-by: Bala.FA <barumuga(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/gluster/hooks.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/21538/1
diff --git a/vdsm/gluster/hooks.py b/vdsm/gluster/hooks.py
index 914d09d..4f1c14d 100644
--- a/vdsm/gluster/hooks.py
+++ b/vdsm/gluster/hooks.py
@@ -244,7 +244,7 @@
@makePublic
def hookAdd(glusterCmd, hookLevel, hookName, hookData, hookMd5Sum,
enable=False):
- hookPath = os.path.join(_glusterHooksPath, glusterCmd, hookLevel)
+ hookPath = os.path.join(_glusterHooksPath, glusterCmd, hookLevel.lower())
try:
os.makedirs(hookPath)
if selinux.is_selinux_enabled():
--
To view, visit http://gerrit.ovirt.org/21538
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic16885a7f837ccceede2cf1b70b5da3138a12a60
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Darshan N <dnarayan(a)redhat.com>
Gerrit-Reviewer: Aravinda VK <avishwan(a)redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
9 years, 9 months
Change in vdsm[ovirt-3.3]: deployUtil: expect integer vlan id from new netinfo
by Dan Kenigsberg
Hello Antoni Segura Puimedon, Amador Pahim,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/21982
to review the following change.
Change subject: deployUtil: expect integer vlan id from new netinfo
......................................................................
deployUtil: expect integer vlan id from new netinfo
Commit 8b2bbe6e5 changed netinfo.getVlanID() to return the vlan id as an
integer, istead of a string. This makes a lot of sense, but breaks
compatibility with ancient deployUtil code.
Change-Id: Ibc1c5875e0d13b110f61f9eabf6d1964fc4c1237
Bug-Url: https://bugzilla.redhat.com/1037277
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21948
Reviewed-by: Amador Pahim <apahim(a)redhat.com>
Reviewed-by: Antoni Segura Puimedon <asegurap(a)redhat.com>
---
M vdsm_reg/deployUtil.py.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/21982/1
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index 2d379f6..ba45d64 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -1061,6 +1061,7 @@
else:
vlan, bonding, nic = _getRHELBridgeParams(mgtIface,
bridgeName=bridgeName)
+ vlan = str(vlan)
fReturn = (nic is not None)
#Delete existing bridge in oVirt
--
To view, visit http://gerrit.ovirt.org/21982
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc1c5875e0d13b110f61f9eabf6d1964fc4c1237
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Amador Pahim <apahim(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 9 months
Change in vdsm[master]: adjust betterPopenTest.py
by xiawenc@linux.vnet.ibm.com
Wenchao Xia has uploaded a new change for review.
Change subject: adjust betterPopenTest.py
......................................................................
adjust betterPopenTest.py
The main function in betterPopenTest is used to check result
after popen, it should not include the betterPopen and test class
code. If it include and the directory it lies on changes, the
import will fail, which means additional python settings should be
passed to betterPopen making things more complicate.
Change-Id: I3059df6abb5c261f45720fc1a3b5266314c62e79
Signed-off-by: wenchao xia <xiawenc(a)linux.vnet.ibm.com>
---
M tests/betterPopenTests.py
1 file changed, 50 insertions(+), 51 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/4585/1
--
To view, visit http://gerrit.ovirt.org/4585
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3059df6abb5c261f45720fc1a3b5266314c62e79
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Wenchao Xia <xiawenc(a)linux.vnet.ibm.com>
9 years, 9 months
Change in vdsm[master]: sp: Fix stopping domain monitors
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: sp: Fix stopping domain monitors
......................................................................
sp: Fix stopping domain monitors
Commit 2671777c69 fixed stopping of domain monitors by stopping monitors from
StoragePool.__del__. This was a dangerous fix because a stray reference to the
pool may delay invocation of __del__ until the referring object is deleted,
delaying stopping of domain monitors for unlimited time. In case of a memory
leak, the pool may never be deleted and domain monitors would never stop.
Fortunately, this fix did seem to work for couple of years, until commit
7b1cc6a20f made the domain monitor pool independent. Instead of one domain
monitor object per pool, there is now a single shared domain monitor object
used by all pool objects. Having a shared domain monitor, the pool __del__
method became deadly.
Shortly after commit 7b1cc6a20f was merged, a new random error appeared in CI
jobs, where there is no storage space left, while storage has plenty of space.
The root cause of the error was anonymous thread running at unexpected times
and stopping silently all domain monitors. Adding some logging revealed that
this thread was started from StoragePool.__del__ method. This thread was
running 14 minutes after the original pool was disconnected, stopping domain
monitors used by the current pool object. It seems that a task was holding a
reference to the old pool, and when the task was finished, the old pool was
finally destroyed.
We seem to stop monitoring when we should, and stopping monitoring in
the __del__ method is redundant. This patch removes the deadly method.
Change-Id: Iad80984ab44dd4a4e36b92330eb9320cf68f1580
Relates-To: https://bugzilla.redhat.com/705058
Relates-To: http://gerrit.ovirt.org/19762
Bug-Url: https://bugzilla.redhat.com/1032925
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/22058/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 31e0bcd..91b27d5 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -140,10 +140,6 @@
def getSpmStatus(self):
return self.spmRole, self.getSpmLver(), self.getSpmId()
- def __del__(self):
- if len(self.domainMonitor.poolMonitoredDomains) > 0:
- threading.Thread(target=self.stopMonitoringDomains).start()
-
@unsecured
def forceFreeSpm(self):
# DO NOT USE, STUPID, HERE ONLY FOR BC
--
To view, visit http://gerrit.ovirt.org/22058
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad80984ab44dd4a4e36b92330eb9320cf68f1580
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
9 years, 9 months
Change in vdsm[master]: vdsm: Handling topology for ppc64
by Dan Kenigsberg
Dan Kenigsberg has posted comments on this change.
Change subject: vdsm: Handling topology for ppc64
......................................................................
Patch Set 7: Code-Review-1
(3 comments)
....................................................
Commit Message
Line 8:
Line 9: This change adds the method to extract the topology from a specific
Line 10: command for ppc64 machines. The current method for x86_64 hasn't
Line 11: been changed.
Line 12: Due libvirt shows wrong information about ppc64 topology, the lscpu
Please include a URL to the relevant libvirt bug. Ovirt may need to circumvent this in the short term, but let's make it easy to revert this patch when the libvirt bug is solved.
Line 13: command is being used to obtain it.
Line 14: The topology tests were changed to be executed in a mock
Line 15: architecture and new test cases were added to handle ppc64 methods.
Line 16:
....................................................
File tests/Makefile.am
Line 91: cpu_info.out \
Line 92: caps_libvirt_intel_E5649.out \
Line 93: caps_libvirt_amd_6274.out \
Line 94: caps_libvirt_intel_E31220.out \
Line 95: caps_lscpu_ppc64_1_4_4.out \
Makefiles love tabs.
Line 96: caps_lscpu_ppc64_2_4_8.out \
Line 97: glob_1c60971a-8647-44ac-ae33-6520887f8843.out \
Line 98: glusterVolumeProfileInfo.xml \
Line 99: glusterVolumeProfileInfoNfs.xml \
....................................................
File tests/capsTests.py
Line 61: testPath = os.path.realpath(__file__)
Line 62: dirName = os.path.split(testPath)[0]
Line 63: # PPC64 1 socket, 4 cores, 4 threads per core
Line 64: path = os.path.join(dirName, "caps_lscpu_ppc64_1_4_4.out")
Line 65: t = caps.CpuTopology(file(path).read())
file() is no longer cool. Use open().
Line 66: self.assertEqual(t.threads(), 16)
Line 67: self.assertEqual(t.cores(), 4)
Line 68: self.assertEqual(t.sockets(), 4)
Line 69: # PPC64 2 sockets, 8 cores, 8 threads per core
--
To view, visit http://gerrit.ovirt.org/19875
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I048d4a6c083392d63fbcff76453e682b9d6f03fc
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Leonardo Bianconi <leonardo.bianconi(a)eldorado.org.br>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa <gustavo.pedrosa(a)eldorado.org.br>
Gerrit-Reviewer: Leonardo Bianconi <leonardo.bianconi(a)eldorado.org.br>
Gerrit-Reviewer: Vitor de Lima <vitor.lima(a)eldorado.org.br>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-HasComments: Yes
9 years, 9 months
Change in vdsm[master]: vdsm-hooks: fix malformed libvirt xml
by apahim@redhat.com
Amador Pahim has uploaded a new change for review.
Change subject: vdsm-hooks: fix malformed libvirt xml
......................................................................
vdsm-hooks: fix malformed libvirt xml
Missing snapshot="no" attribute is leding Storage Live Migration
to fail.
This patch adds snapshot="no" attribute to vdsm-hooks adding
disks/directlun.
Change-Id: Id6422c45450ffc65e4fe84ab7d66a30a285dd42a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1036111
Signed-off-by: Amador Pahim <apahim(a)redhat.com>
---
M vdsm_hooks/directlun/before_vm_start.py
M vdsm_hooks/scratchpad/before_vm_start.py
M vdsm_hooks/vmdisk/before_vm_start.py
3 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/21913/1
diff --git a/vdsm_hooks/directlun/before_vm_start.py b/vdsm_hooks/directlun/before_vm_start.py
index bde62a2..4de5875 100755
--- a/vdsm_hooks/directlun/before_vm_start.py
+++ b/vdsm_hooks/directlun/before_vm_start.py
@@ -25,7 +25,7 @@
def createDiskElement(domxml, devpath, lunid, options):
'''
- <disk device="disk" type="block">
+ <disk device="disk" type="block" snapshot="no">
<source dev="/dev/mapper/lunid"/>
<target bus="virtio" dev="vda"/>
<driver cache="none" error_policy="stop" name="qemu" type="raw"/>
@@ -35,6 +35,7 @@
disk = domxml.createElement('disk')
disk.setAttribute('device', 'disk')
disk.setAttribute('type', 'block')
+ disk.setAttribute('snapshot', 'no')
source = domxml.createElement('source')
source.setAttribute('dev', devpath)
diff --git a/vdsm_hooks/scratchpad/before_vm_start.py b/vdsm_hooks/scratchpad/before_vm_start.py
index 2f2fe3f..2e5ddc6 100755
--- a/vdsm_hooks/scratchpad/before_vm_start.py
+++ b/vdsm_hooks/scratchpad/before_vm_start.py
@@ -53,7 +53,7 @@
def add_disk(domxml, path):
'''
Create libvirt xml node
- <disk device="disk" type="file">
+ <disk device="disk" type="file" snapshot="no">
<source file="[path to image]"/>
<driver cache="writeback" error_policy="stop" type="raw"/>
</disk>
@@ -62,6 +62,7 @@
disk = domxml.createElement('disk')
disk.setAttribute('device', 'disk')
disk.setAttribute('type', 'file')
+ disk.setAttribute('snapshot', 'no')
source = domxml.createElement('source')
source.setAttribute('file', path)
diff --git a/vdsm_hooks/vmdisk/before_vm_start.py b/vdsm_hooks/vmdisk/before_vm_start.py
index 0d3ee0a..c08c645 100755
--- a/vdsm_hooks/vmdisk/before_vm_start.py
+++ b/vdsm_hooks/vmdisk/before_vm_start.py
@@ -27,7 +27,7 @@
def createDiskElement(domxml, devpath, drivertype):
'''
- <disk device="disk" type="file">
+ <disk device="disk" type="file" snapshot="no">
<source file="/net/myhost/myimage.img"/>
<target bus="virtio" dev="vda"/>
<driver cache="none" error_policy="stop" name="qemu" type="qcow2"/>
@@ -37,6 +37,7 @@
disk = domxml.createElement('disk')
disk.setAttribute('device', 'disk')
disk.setAttribute('type', 'file')
+ disk.setAttribute('snapshot', 'no')
source = domxml.createElement('source')
source.setAttribute('file', devpath)
--
To view, visit http://gerrit.ovirt.org/21913
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6422c45450ffc65e4fe84ab7d66a30a285dd42a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <apahim(a)redhat.com>
9 years, 9 months
Change in vdsm[master]: sp: remove the getFormat method
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: sp: remove the getFormat method
......................................................................
sp: remove the getFormat method
Change-Id: Ifb292ef57f94e1fea67f3111e5f414cc41c346a9
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 1 insertion(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/21785/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 58ad3df..8ae733b 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1099,7 +1099,7 @@
isMsd = (self.masterDomain.sdUUID == sdUUID)
if targetFormat is None:
- targetFormat = self.getFormat()
+ targetFormat = str(self.getVersion())
try:
self._formatConverter.convert(
@@ -1110,10 +1110,6 @@
# conversion supposedly failed.
sdCache.manuallyRemoveDomain(sdUUID)
sdCache.produce(sdUUID)
-
- @unsecured
- def getFormat(self):
- return str(self.getVersion())
def activateSD(self, sdUUID):
"""
--
To view, visit http://gerrit.ovirt.org/21785
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb292ef57f94e1fea67f3111e5f414cc41c346a9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
9 years, 9 months
Change in vdsm[master]: ip monitor: replace pairwise with grouper
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: ip monitor: replace pairwise with grouper
......................................................................
ip monitor: replace pairwise with grouper
pairwise takes an iterator or elements '123456789' and generates an
iterator that gives: ('1', '2'), ('2', '3'), ('3', '4'), ('4', '5')...
grouper takes an iterator or elements '123456789' and generates an
iterator that gives: [('1', '2'), ('3', '4'), ('5', '6'), ('7', '8'), ('9',
None)]
Since the data to parse from iproute2 commands is structured closer
to grouper, change to that.
Change-Id: Ie1c569cee85c2d4fd54cbd8e6d964c2291056c6c
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/ipwrapper.py
M lib/vdsm/utils.py
2 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/22092/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 676bdba..394e9a4 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -31,7 +31,7 @@
from .utils import CommandPath
from .utils import execCmd
from .utils import memoized
-from .utils import pairwise
+from .utils import grouper
_IP_BINARY = CommandPath('ip', '/sbin/ip')
_ETHTOOL_BINARY = CommandPath('ethtool',
@@ -118,7 +118,7 @@
baseData = (el for el in values.strip().split(' ') if el and
el != 'link/none')
- for key, value in pairwise(baseData):
+ for key, value in grouper(baseData, 2):
if key.startswith('link/'):
key = 'address'
attrs[key] = value
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index fb2c03d..966e1f3 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -983,12 +983,12 @@
# Copied from
-# http://docs.python.org/2.6/library/itertools.html?highlight=pairwise#recipes
-def pairwise(iterable):
- "s -> (s0,s1), (s1,s2), (s2, s3), ..."
- a, b = itertools.tee(iterable)
- next(b, None)
- return itertools.izip(a, b)
+# http://docs.python.org/2.6/library/itertools.html?highlight=grouper#recipes
+def grouper(iterable, n, fillvalue=None):
+ "Collect data into fixed-length chunks or blocks"
+ # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx
+ args = [iter(iterable)] * n
+ return itertools.izip_longest(fillvalue=fillvalue, *args)
def anyFnmatch(name, patterns):
--
To view, visit http://gerrit.ovirt.org/22092
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1c569cee85c2d4fd54cbd8e6d964c2291056c6c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 9 months
Change in vdsm[master]: netinfo: Introduce linkPool
by asegurap@redhat.com
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netinfo: Introduce linkPool
......................................................................
netinfo: Introduce linkPool
linkPool is a dictionary that always contains the device links
present in the system as keys.
The values are initially Link objects but when an event is received
the event is put on place of the link object (this is likely to
change into keeping Link objects, but if it is the case, it will
be in a follow up patch).
This linkPool will be used for various things.
- The sampling thread will always know which devices to report.
- Netinfo object creation will be significantly cheaper if
it the links are on memory.
Change-Id: I819a4b271955baaf14b3d12883ccfe7fda90b7d1
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/22057/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index edc1c13..0af9b8d 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -27,6 +27,7 @@
import shlex
import socket
import struct
+import threading
from xml.dom import minidom
import ethtool
@@ -35,6 +36,7 @@
from . import constants
from .ipwrapper import getLink, getLinks
from .ipwrapper import IPRoute2Error
+from .ipwrapper import Monitor
from .ipwrapper import Route
from .ipwrapper import routeGet
from .ipwrapper import routeShowAllDefaultGateways
@@ -68,6 +70,28 @@
OPERSTATE_UP = 'up'
+linkPool = {}
+
+
+def _linkPoolUpdater():
+ mon = Monitor()
+ mon.start()
+ for event in mon:
+ if event.state == Monitor.LINK_STATE_DELETED:
+ try:
+ del linkPool[event.device]
+ except KeyError:
+ logging.debug('Failed to remove link pool device %s which was '
+ 'not on the pool', event.device)
+ else:
+ linkPool[event.device] = event
+
+
+# netinfo link pool handling
+for link in getLinks():
+ linkPool[link.name] = link
+threading.Thread(target=_linkPoolUpdater, name='linkPool').start()
+
def nics():
"""Returns a list of nics and fake nics devices available (not hidden) to
--
To view, visit http://gerrit.ovirt.org/22057
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I819a4b271955baaf14b3d12883ccfe7fda90b7d1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
9 years, 9 months
Change in vdsm[master]: vm: janitorial: replace file() with open()
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: janitorial: replace file() with open()
......................................................................
vm: janitorial: replace file() with open()
As per docs, open() is preferred to file():
http://docs.python.org/2/library/functions.html#file
moreover, file() was removed in python3:
http://docs.python.org/release/3.0/whatsnew/3.0.html#builtins
Change-Id: I39c604b53e812a838542c94349cb64c272bea552
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/22034/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index b037d3c..4be5466 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -244,7 +244,7 @@
fname = self._vm.cif.prepareVolumePath(self._dstparams)
try:
- with file(fname, "w") as f:
+ with open(fname, "w") as f:
pickle.dump(self._machineParams, f)
finally:
self._vm.cif.teardownVolumePath(self._dstparams)
@@ -3795,7 +3795,7 @@
vmConfVolPath = self.cif.prepareVolumePath(vmConfVol)
vmConf = _vmConfForMemorySnapshot()
try:
- with file(vmConfVolPath, "w") as f:
+ with open(vmConfVolPath, "w") as f:
pickle.dump(vmConf, f)
finally:
self.cif.teardownVolumePath(vmConfVol)
--
To view, visit http://gerrit.ovirt.org/22034
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I39c604b53e812a838542c94349cb64c272bea552
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years, 9 months