Nir Soffer has posted comments on this change.
Change subject: utils: Moved RollbackContext from misc to utils ......................................................................
Patch Set 3:
(3 comments)
Looks good, needs little cleanup.
.................................................... Commit Message Line 7: utils: Moved RollbackContext from misc to utils Line 8: Line 9: The RollbackContext class was located in storage/misc, and is used by Line 10: several non-storage tests. It was therefore moved to utils, where it Line 11: belongs. Accordingly, ContextManagerTests class was moved to utilsTests Replace "ContextManagerTests" with "RollbackContextTests" Line 12: from miscTests. Line 13: Line 14: Change-Id: I985103650a5706d35d9cd519618d09c692feb0be
.................................................... File lib/vdsm/utils.py Line 1091: def undoStep2(arg): pass Line 1092: step2() Line 1093: rollback.prependDefer(undoStep2, arg) Line 1094: Line 1095: More examples see tests/miscTests.py Replace "miscTests.py" to "utilsTests.py" Line 1096: ''' Line 1097: def __init__(self, *args): Line 1098: self._finally = [] Line 1099:
.................................................... File vdsm/storage/resourceManager.py Line 28: Line 29: import storage_exception as se Line 30: import misc Line 31: from logUtils import SimpleLogAdapter Line 32: from vdsm.utils import RollbackContext Please keep the previous way, importing utils, and using utils.RollbackContext.
We don't have yet a policy to import only modules, but we should have. Line 33: Line 34: Line 35: # Errors Line 36: