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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 596 Revision 625
95 for part in ips: 95 for part in ips:
96 tmppart = ips[part] 96 tmppart = ips[part]
97 existing = False 97 existing = False
98 if tmppart['origminor'] and not tmppart['format']: 98 if tmppart['origminor'] and not tmppart['format']:
99 existing = True 99 existing = True
100 self._partitions[tmppart['minor']] = Partition(self, tmppart['minor'], tmppart['mb'], tmppart['start'], tmppart['end'], tmppart['type'], format=tmppart['format'], origminor=tmppart['origminor'], existing=existing, mountpoint=tmppart['mountpoint'], mountopts=['mountopts']) 100 self._partitions[tmppart['minor']] = Partition(self, tmppart['minor'], tmppart['mb'], tmppart['start'], tmppart['end'], tmppart['type'], format=tmppart['format'], origminor=tmppart['origminor'], existing=existing, mountpoint=tmppart['mountpoint'], mountopts=tmppart['mountopts'])
101 101
102 ## 102 ##
103 # Returns name of device (e.g. /dev/hda) being represented 103 # Returns name of device (e.g. /dev/hda) being represented
104 def get_device(self): 104 def get_device(self):
105 return self._device 105 return self._device
313 return minor 313 return minor
314 314
315 ## 315 ##
316 # Returns an ordered list (disk order) of partition minors 316 # Returns an ordered list (disk order) of partition minors
317 def get_ordered_partition_list(self): 317 def get_ordered_partition_list(self):
318 parts = self._partitions.keys() 318 parts = self._partitions.keys()
319 parts.sort() 319 parts.sort()
320 partlist = [] 320 partlist = []
321 tmppart = None 321 tmppart = None
322 for part in parts: 322 for part in parts:
323 if archinfo[self._arch]['extended'] and part > 4.1: break 323 if archinfo[self._arch]['extended'] and part > 4.1: break
324 tmppart = self._partitions[part] 324 tmppart = self._partitions[part]
325 partlist.append(part) 325 partlist.append(part)
344 for part in self._partitions: 344 for part in self._partitions:
345 tmppart = self._partitions[part] 345 tmppart = self._partitions[part]
346 if tmppart.is_extended(): 346 if tmppart.is_extended():
347 return part 347 return part
348 return 0 348 return 0
349
350 ##
351 # Returns the drive model
352 def get_model(self):
353 return self._parted_dev.model
349 354
350 ## 355 ##
351 # Sets the disklabel type 356 # Sets the disklabel type
352 def set_disklabel(self, disklabel): 357 def set_disklabel(self, disklabel):
353 self._disklabel = disklabel 358 self._disklabel = disklabel
474 label_type = device._parted_disk.type.name 479 label_type = device._parted_disk.type.name
475 if label_type == "loop": 480 if label_type == "loop":
476 dev_node = device._device 481 dev_node = device._device
477 else: 482 else:
478 dev_node = device._device + str(self._orig_minor) 483 dev_node = device._device + str(self._orig_minor)
479 print "dev_node = " + dev_node 484# print "dev_node = " + dev_node
480 if type == "ntfs": 485 if type == "ntfs":
481 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 .\+//'")) 486 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 .\+//'"))
482 self._min_mb_for_resize = int(min_bytes / MEGABYTE) + 1 487 self._min_mb_for_resize = int(min_bytes / MEGABYTE) + 1
483 self._resizeable = True 488 self._resizeable = True
484 elif type == "ext2" or type == "ext3": 489 elif type == "ext2" or type == "ext3":

Legend:
Removed from v.596  
changed lines
  Added in v.625

  ViewVC Help
Powered by ViewVC 1.1.20