- if not os.path.exists (containerDir):
- pass
- else:
- # if it's empty then let's clean it up
- if not os.listdir(containerDir):
- # clean up rootfs as userdel will only take care of /home/<slicename>
- logger.log("sliver_lxc: %s: WARNING cleaning up empty %s"%(name,containerDir))
- command = ['btrfs', 'subvolume', 'delete', containerDir]
- logger.log_call(command, timeout=60)
- # re-check
- if os.path.exists (containerDir):
- logger.log('sliver_lxc: %s: ERROR Could not create sliver - could not clean up empty %s'%(name,containerDir))
- return
- else:
- logger.log('sliver_lxc: %s: ERROR Could not create sliver - could not clean up pre-existing %s'%(name,containerDir))
+ # this hopefully could be removed in a future release
+ if os.path.exists (containerDir):
+ logger.log("sliver_lxc: %s: WARNING cleaning up pre-existing %s"%(name,containerDir))
+ command = ['btrfs', 'subvolume', 'delete', containerDir]
+ logger.log_call(command, BTRFS_TIMEOUT)
+ # re-check
+ if os.path.exists (containerDir):
+ logger.log('sliver_lxc: %s: ERROR Could not create sliver - could not clean up empty %s'%(name,containerDir))