Change in vdsm[master]: Update except syntax according to pep3110.

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Tue Jan 15 05:48:44 UTC 2013


Zhou Zheng Sheng has posted comments on this change.

Change subject: Update except syntax according to pep3110.
......................................................................


Patch Set 2: (4 inline comments)

....................................................
File vdsm_cli/vdsClient.py
Line 2428:         if code != 0:
Line 2429:             code = 1
Line 2430:         print message
Line 2431:         sys.exit(code)
Line 2432:     except (TypeError, IndexError, ValueError), e:
Is this one to be changed as well?
Line 2433:         print "Error using command:", e, "\n"
Line 2434:         print command
Line 2435:         for line in commands[command][1]:
Line 2436:             print '\t' + line


....................................................
File vdsm_reg/vdsm-reg-setup.in
Line 312:                     sys.exit(1)
Line 313:             elif o == "-l":
Line 314:                 daemonize = False
Line 315:     except getopt.GetoptError,e:
Line 316:         print "ERROR: '%s'"%(e.msg)
Does it need to change to the following?

  except getopt.GetoptError as e:
Line 317:         usage()
Line 318:         sys.exit(1)


....................................................
File vdsm/storage/misc.py
Line 1383: 
Line 1384:     while True:
Line 1385:         try:
Line 1386:             return pollfun(timeout)
Line 1387:         except (IOError, select.error), e:
Does it need to change to the following?

  except (IOError, select.error) as e:
Line 1388:             if e.args[0] != errno.EINTR:
Line 1389:                 raise
Line 1390:         timeout = max(0, endtime - time.time())
Line 1391: 


....................................................
File vdsm/storage/resourceFactories.py
Line 171:                     volUUID, lockType,
Line 172:                     timeout=self.resource_default_timeout)
Line 173: 
Line 174:                 volResourcesList.append(volRes)
Line 175:         except (rm.RequestTimedOutError, se.ResourceAcqusitionFailed), e:
Does it need to change to the following?

  except (rm.RequestTimedOutError, se.ResourceAcqusitionFailed) as e:
Line 176:             log.debug("Cannot acquire volume resource (%s)", str(e))
Line 177:             failed = True
Line 178:             raise
Line 179:         except Exception:


--
To view, visit http://gerrit.ovirt.org/10942
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2c4ac78dace34a41e1afb9f6560889ad9bd34ddf
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <ewoud at kohlvanwijngaarden.nl>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list