def _wipe(self, dname, request): disk = self._validate_disk(dname, request) wipe_disk(disk.name) disk.parted = False disk.btrfs_uuid = None disk.save() return Response(DiskInfoSerializer(disk).data)
def _wipe(self, dname, request): disk = self._validate_disk(dname, request) try: wipe_disk(disk.name) except Exception, e: logger.exception(e) e_msg = ('Failed to wipe the disk due to a system error.') handle_exception(Exception(e_msg), request)
def btrfs_disk_wipe(dname): disks = btrfs_disk_scan() for disk in disks: if disk["name"] == dname: wipe_disk(dname) disk["parted"] = False disk["btrfs_uuid"] = None return disk return None