Changeset 70548 in vbox for trunk/src/VBox/ValidationKit/testboxscript/testboxupgrade.py
- Timestamp:
- Jan 11, 2018 8:46:02 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120222
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/testboxupgrade.py
r69111 r70548 90 90 for sMember in asMembers: 91 91 if sMember.endswith('/'): 92 os.makedirs(os.path.join(sUpgradeDir, sMember.replace('/', os.path.sep)), 0 775);92 os.makedirs(os.path.join(sUpgradeDir, sMember.replace('/', os.path.sep)), 0o775); 93 93 else: 94 94 oZip.extract(sMember, sUpgradeDir); … … 110 110 return False; 111 111 try: 112 os.chmod(sFull, 0 755);113 except Exception ,oXcpt:112 os.chmod(sFull, 0o755); 113 except Exception as oXcpt: 114 114 testboxcommons.log('warning chmod error on %s: %s' % (sFull, oXcpt)); 115 115 return True; … … 170 170 sFull = os.path.join(g_ksValidationKitDir, sMember); 171 171 if not os.path.isdir(sFull): 172 os.makedirs(sFull, 0 755);172 os.makedirs(sFull, 0o755); 173 173 174 174 # … … 189 189 try: 190 190 os.rename(sDst, sDstRm); 191 except Exception ,oXcpt:191 except Exception as oXcpt: 192 192 testboxcommons.log('Error: failed to rename (old) "%s" to "%s": %s' % (sDst, sDstRm, oXcpt)); 193 193 try: 194 194 shutil.copy(sDst, sDstRm); 195 except Exception ,oXcpt:195 except Exception as oXcpt: 196 196 testboxcommons.log('Error: failed to copy (old) "%s" to "%s": %s' % (sDst, sDstRm, oXcpt)); 197 197 break; 198 198 try: 199 199 os.unlink(sDst); 200 except Exception ,oXcpt:200 except Exception as oXcpt: 201 201 testboxcommons.log('Error: failed to unlink (old) "%s": %s' % (sDst, oXcpt)); 202 202 break; … … 206 206 try: 207 207 os.rename(sSrc, sDst); 208 except Exception ,oXcpt:208 except Exception as oXcpt: 209 209 testboxcommons.log('Warning: failed to rename (new) "%s" to "%s": %s' % (sSrc, sDst, oXcpt)); 210 210 try: … … 259 259 try: 260 260 os.rmdir(sFull); 261 except Exception ,oXcpt:261 except Exception as oXcpt: 262 262 testboxcommons.log('Warning: failed to rmdir obsolete dir "%s": %s' % (sFull, oXcpt)); 263 263 … … 268 268 try: 269 269 os.unlink(sFull); 270 except Exception ,oXcpt:270 except Exception as oXcpt: 271 271 testboxcommons.log('Warning: failed to unlink obsolete file "%s": %s' % (sFull, oXcpt)); 272 272 return True;
Note:
See TracChangeset
for help on using the changeset viewer.