/[gli]/trunk/src/GLIStorageDevice.py
Gentoo

Diff of /trunk/src/GLIStorageDevice.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 386 Revision 466
310 self._format = format 310 self._format = format
311 if blocks == 0: 311 if blocks == 0:
312 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512 312 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
313 if existing: 313 if existing:
314 parted_part = device._parted_disk.get_partition(minor) 314 parted_part = device._parted_disk.get_partition(minor)
315 label_type = device._parted_disk.type.name
316 if label_type == "loop":
317 dev_node = device._device
318 else:
319 dev_node = device._device + str(minor)
315 if type == "ntfs": 320 if type == "ntfs":
316 min_bytes = int(commands.getoutput("ntfsresize -f --info " + device._device + str(minor) + " | grep -e '^You might resize' | sed -e 's/You might resize at //' -e 's/ bytes or .\+//'")) 321 min_bytes = int(commands.getoutput("ntfsresize -f --info " + dev_node + " | grep -e '^You might resize' | sed -e 's/You might resize at //' -e 's/ bytes or .\+//'"))
317 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1 322 self._min_cylinders_for_resize = int(min_bytes / self._device._cylinder_bytes) + 1
318 self._resizeable == True 323 self._resizeable == True
319 elif type == "ext2" or type == "ext3": 324 elif type == "ext2" or type == "ext3":
320 block_size = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + r" 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'")) 325 block_size = string.strip(commands.getoutput("dumpe2fs -h " + dev_node + r" 2>&1 | grep -e '^Block size:' | sed -e 's/^Block size:\s\+//'"))
321 free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + device._device + str(minor) + r" 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'")) 326 free_blocks = string.strip(commands.getoutput("dumpe2fs -h " + dev_node + r" 2>&1 | grep -e '^Free blocks:' | sed -e 's/^Free blocks:\s\+//'"))
322 free_sec = int(int(block_size) * int(free_blocks) / self._device._sector_bytes) 327 free_sec = int(int(block_size) * int(free_blocks) / self._device._sector_bytes)
323 free_sec = free_sec - 2000 # just to be safe 328 free_sec = free_sec - 2000 # just to be safe
324 self._min_sectors_for_resize = (self._end - self._start + 1) - free_sec 329 self._min_sectors_for_resize = (self._end - self._start + 1) - free_sec
325 self._resizeable == True 330 self._resizeable == True
326 else: 331 else:

Legend:
Removed from v.386  
changed lines
  Added in v.466

  ViewVC Help
Powered by ViewVC 1.1.20