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

Diff of /trunk/src/GLIStorageDevice.py

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

Revision 508 Revision 509
23 _parted_disk = None 23 _parted_disk = None
24 _sector_bytes = 0 24 _sector_bytes = 0
25 _total_mb = 0 25 _total_mb = 0
26 _arch = None 26 _arch = None
27 27
28 ##
29 # Brief description of function
30 # @param self Parameter description
31 # @param device Parameter description
32 # @param arch="x86" Parameter description
28 def __init__(self, device, arch="x86"): 33 def __init__(self, device, arch="x86"):
29 self._device = device 34 self._device = device
30 self._partitions = {} 35 self._partitions = {}
31 self._geometry = {'cylinders': 0, 'heads': 0, 'sectors': 0, 'sectorsize': 512} 36 self._geometry = {'cylinders': 0, 'heads': 0, 'sectors': 0, 'sectorsize': 512}
32 self._total_bytes = 0 37 self._total_bytes = 0
34 self._arch = arch 39 self._arch = arch
35 self._parted_dev = parted.PedDevice.get(self._device) 40 self._parted_dev = parted.PedDevice.get(self._device)
36 self._parted_disk = parted.PedDisk.new(self._parted_dev) 41 self._parted_disk = parted.PedDisk.new(self._parted_dev)
37 self.set_disk_geometry_from_disk() 42 self.set_disk_geometry_from_disk()
38 43
44 ##
45 # Brief description of function
46 # @param self Parameter description
39 def set_disk_geometry_from_disk(self): 47 def set_disk_geometry_from_disk(self):
40 self._total_bytes = self._parted_dev.length * self._parted_dev.sector_size 48 self._total_bytes = self._parted_dev.length * self._parted_dev.sector_size
41 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = self._parted_dev.heads, self._parted_dev.sectors, self._parted_dev.cylinders 49 self._geometry['heads'], self._geometry['sectors'], self._geometry['cylinders'] = self._parted_dev.heads, self._parted_dev.sectors, self._parted_dev.cylinders
42 self._sector_bytes = self._parted_dev.sector_size 50 self._sector_bytes = self._parted_dev.sector_size
43 self._cylinder_bytes = self._geometry['heads'] * self._geometry['sectors'] * self._sector_bytes 51 self._cylinder_bytes = self._geometry['heads'] * self._geometry['sectors'] * self._sector_bytes
44 self._total_sectors = self._parted_dev.length 52 self._total_sectors = self._parted_dev.length
45 self._sectors_in_cylinder = self._geometry['heads'] * self._geometry['sectors'] 53 self._sectors_in_cylinder = self._geometry['heads'] * self._geometry['sectors']
46 self._total_mb = int(self._total_bytes / MEGABYTE) 54 self._total_mb = int(self._total_bytes / MEGABYTE)
47 55
56 ##
57 # Brief description of function
58 # @param self Parameter description
48 def set_partitions_from_disk(self): 59 def set_partitions_from_disk(self):
49 last_part = 0 60 last_part = 0
50 last_log_part = 4 61 last_log_part = 4
51 parted_part = self._parted_disk.next_partition() 62 parted_part = self._parted_disk.next_partition()
52 while parted_part: 63 while parted_part:
68 else: 79 else:
69 self._partitions[Decimal(str(float(last_part+0.1)))] = Partition(self, Decimal(str(float(last_part+0.1))), part_mb, parted_part.geom.start, parted_part.geom.end, "free", format=False, existing=False) 80 self._partitions[Decimal(str(float(last_part+0.1)))] = Partition(self, Decimal(str(float(last_part+0.1))), part_mb, parted_part.geom.start, parted_part.geom.end, "free", format=False, existing=False)
70 last_part += 1 81 last_part += 1
71 parted_part = self._parted_disk.next_partition(parted_part) 82 parted_part = self._parted_disk.next_partition(parted_part)
72 83
84 ##
85 # Brief description of function
86 # @param self Parameter description
87 # @param ips Parameter description
73 def set_partitions_from_install_profile_structure(self, ips): 88 def set_partitions_from_install_profile_structure(self, ips):
74 pass 89 pass
75# for part in ips: 90# for part in ips:
76# tmppart = ips[part] 91# tmppart = ips[part]
77# existing = False 92# existing = False
84# if parted_part.type == 2: fs_type = "extended" 99# if parted_part.type == 2: fs_type = "extended"
85# if int(tmppart['start']) == int(start) and int(tmppart['end']) == int(end) and tmppart['type'] == fs_type and tmppart['format'] == False: 100# if int(tmppart['start']) == int(start) and int(tmppart['end']) == int(end) and tmppart['type'] == fs_type and tmppart['format'] == False:
86# existing = True 101# existing = True
87# self._partitions[int(part)] = Partition(self, part, '', tmppart['start'], tmppart['end'], 0, tmppart['type'], mountopts=tmppart['mountopts'], mountpoint=tmppart['mountpoint'], format=tmppart['format'], existing=(not tmppart['format'])) 102# self._partitions[int(part)] = Partition(self, part, '', tmppart['start'], tmppart['end'], 0, tmppart['type'], mountopts=tmppart['mountopts'], mountpoint=tmppart['mountpoint'], format=tmppart['format'], existing=(not tmppart['format']))
88 103
104 ##
105 # Brief description of function
106 # @param self Parameter description
89 def get_device(self): 107 def get_device(self):
90 return self._device 108 return self._device
91 109
110 ##
111 # Brief description of function
112 # @param self Parameter description
92 def tidy_partitions(self): 113 def tidy_partitions(self):
93 last_minor = 0 114 last_minor = 0
94 last_log_minor = 4 115 last_log_minor = 4
95 last_free = 0 116 last_free = 0
96 last_log_free = 0 117 last_log_free = 0
142 self._partitions[last_minor] = tmppart 163 self._partitions[last_minor] = tmppart
143 del self._partitions[part] 164 del self._partitions[part]
144 continue 165 continue
145 last_minor = part 166 last_minor = part
146 167
168 ##
169 # Brief description of function
170 # @param self Parameter description
171 # @param free_minor Parameter description
172 # @param mb Parameter description
173 # @param start Parameter description
174 # @param end Parameter description
175 # @param type Parameter description
176 # @param mountpoint='' Parameter description
177 # @param mountopts='' Parameter description
147 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts=''): 178 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts=''):
148 free_minor = Decimal(str(free_minor)) 179 free_minor = Decimal(str(free_minor))
149 new_minor = int(free_minor) + 1 180 new_minor = int(free_minor) + 1
150# print "add_partition(): free_minor=" + str(free_minor) + ", new_minor=" + str(new_minor) 181# print "add_partition(): free_minor=" + str(free_minor) + ", new_minor=" + str(new_minor)
151 if self._partitions.has_key(new_minor): 182 if self._partitions.has_key(new_minor):
180 self._partitions[new_minor] = Partition(self, new_minor, mb, start, end, type, mountpoint=mountpoint, mountopts=mountopts) 211 self._partitions[new_minor] = Partition(self, new_minor, mb, start, end, type, mountpoint=mountpoint, mountopts=mountopts)
181 if type == "extended": 212 if type == "extended":
182 self._partitions[Decimal("4.9")] = Partition(self, Decimal("4.9"), mb, 0, 0, "free") 213 self._partitions[Decimal("4.9")] = Partition(self, Decimal("4.9"), mb, 0, 0, "free")
183 self.tidy_partitions() 214 self.tidy_partitions()
184 215
216 ##
217 # Brief description of function
218 # @param self Parameter description
219 # @param minor Parameter description
185 def remove_partition(self, minor): 220 def remove_partition(self, minor):
186 tmppart = self._partitions[int(minor)] 221 tmppart = self._partitions[int(minor)]
187 free_minor = 0 222 free_minor = 0
188 if tmppart.is_logical(): 223 if tmppart.is_logical():
189 free_minor = Decimal(str(float(minor)-0.1)) 224 free_minor = Decimal(str(float(minor)-0.1))
191 free_minor = Decimal(str(float(minor)-0.9)) 226 free_minor = Decimal(str(float(minor)-0.9))
192 self._partitions[free_minor] = Partition(self, free_minor, tmppart.get_mb(), 0, 0, "free", format=False, existing=False) 227 self._partitions[free_minor] = Partition(self, free_minor, tmppart.get_mb(), 0, 0, "free", format=False, existing=False)
193 del self._partitions[int(minor)] 228 del self._partitions[int(minor)]
194 self.tidy_partitions() 229 self.tidy_partitions()
195 230
231 ##
232 # Brief description of function
233 # @param self Parameter description
234 # @param start Parameter description
196 def get_free_space(self, start): 235 def get_free_space(self, start):
197 GAP_SIZE = 100 236 GAP_SIZE = 100
198 parts = self._partitions.keys() 237 parts = self._partitions.keys()
199 parts.sort() 238 parts.sort()
200 lastend_pri = 0 239 lastend_pri = 0
227 if free_start == -1 and lastend_pri < self._total_sectors: 266 if free_start == -1 and lastend_pri < self._total_sectors:
228 free_start = lastend_pri 267 free_start = lastend_pri
229 free_end = self._total_sectors 268 free_end = self._total_sectors
230 return (free_start, free_end) 269 return (free_start, free_end)
231 270
271 ##
272 # Brief description of function
273 # @param self Parameter description
274 # @param sector Parameter description
275 # @param ignore_extended=1 Parameter description
232 def get_partition_at(self, sector, ignore_extended=1): 276 def get_partition_at(self, sector, ignore_extended=1):
233 parts = self._partitions.keys() 277 parts = self._partitions.keys()
234 parts.sort() 278 parts.sort()
235 for part in parts: 279 for part in parts:
236 tmppart = self._partitions[part] 280 tmppart = self._partitions[part]
237 if ignore_extended and tmppart.is_extended(): continue 281 if ignore_extended and tmppart.is_extended(): continue
238 if (sector >= tmppart.get_start()) and (sector <= tmppart.get_end()): 282 if (sector >= tmppart.get_start()) and (sector <= tmppart.get_end()):
239 return part 283 return part
240 return 0 284 return 0
241 285
286 ##
287 # Brief description of function
288 # @param self Parameter description
289 # @param start Parameter description
290 # @param end Parameter description
242 def get_free_minor_at(self, start, end): 291 def get_free_minor_at(self, start, end):
243 parts = self._partitions.keys() 292 parts = self._partitions.keys()
244 parts.sort() 293 parts.sort()
245 minor = 1 294 minor = 1
246 lastpart = 0 295 lastpart = 0
266 break 315 break
267 minor = part + 1 316 minor = part + 1
268 lastpart = part 317 lastpart = part
269 return minor 318 return minor
270 319
320 ##
321 # Brief description of function
322 # @param self Parameter description
271 def get_ordered_partition_list(self): 323 def get_ordered_partition_list(self):
272 parts = self._partitions.keys() 324 parts = self._partitions.keys()
273 parts.sort() 325 parts.sort()
274 partlist = [] 326 partlist = []
275 tmppart = None 327 tmppart = None
283 if part_log < Decimal("4.9"): continue 335 if part_log < Decimal("4.9"): continue
284 tmppart_log = self._partitions[part_log] 336 tmppart_log = self._partitions[part_log]
285 partlist.append(part_log) 337 partlist.append(part_log)
286 return partlist 338 return partlist
287 339
340 ##
341 # Brief description of function
342 # @param self Parameter description
288 def get_install_profile_structure(self): 343 def get_install_profile_structure(self):
289 devdic = {} 344 devdic = {}
290 for part in self._partitions: 345 for part in self._partitions:
291 tmppart = self._partitions[part] 346 tmppart = self._partitions[part]
292 devdic[part] = { 'mb': tmppart.get_mb(), 'minor': float(part), 'origminor': tmppart.get_orig_minor(), 'start': tmppart.get_start(), 'end': tmppart.get_end(), 'type': tmppart.get_type(), 'mountpoint': tmppart.get_mountpoint(), 'mountopts': tmppart.get_mountopts(), 'format': tmppart.get_format() } 347 devdic[part] = { 'mb': tmppart.get_mb(), 'minor': float(part), 'origminor': tmppart.get_orig_minor(), 'start': tmppart.get_start(), 'end': tmppart.get_end(), 'type': tmppart.get_type(), 'mountpoint': tmppart.get_mountpoint(), 'mountopts': tmppart.get_mountopts(), 'format': tmppart.get_format() }
293 return devdic 348 return devdic
294 349
350 ##
351 # Brief description of function
352 # @param self Parameter description
295 def get_extended_partition(self): 353 def get_extended_partition(self):
296 for part in self._partitions: 354 for part in self._partitions:
297 tmppart = self._partitions[part] 355 tmppart = self._partitions[part]
298 if tmppart.is_extended(): 356 if tmppart.is_extended():
299 return part 357 return part
300 return 0 358 return 0
301 359
360 ##
361 # Brief description of function
362 # @param self Parameter description
302 def get_num_sectors(self): 363 def get_num_sectors(self):
303 return int(self._total_sectors) 364 return int(self._total_sectors)
304 365
366 ##
367 # Brief description of function
368 # @param self Parameter description
305 def get_cylinder_size(self): 369 def get_cylinder_size(self):
306 return int(self._cylinder_bytes) 370 return int(self._cylinder_bytes)
307 371
372 ##
373 # Brief description of function
374 # @param self Parameter description
308 def get_sector_size(self): 375 def get_sector_size(self):
309 return int(self._sector_bytes) 376 return int(self._sector_bytes)
310 377
378 ##
379 # Brief description of function
380 # @param self Parameter description
311 def get_num_cylinders(self): 381 def get_num_cylinders(self):
312 return int(self._geometry['cylinders']) 382 return int(self._geometry['cylinders'])
313 383
384 ##
385 # Brief description of function
386 # @param self Parameter description
314 def get_drive_bytes(self): 387 def get_drive_bytes(self):
315 return int(self._total_bytes) 388 return int(self._total_bytes)
316 389
390 ##
391 # Brief description of function
392 # @param self Parameter description
317 def get_total_mb(self): 393 def get_total_mb(self):
318 return self._total_mb 394 return self._total_mb
319 395
396 ##
397 # Brief description of function
398 # @param self Parameter description
320 def get_partitions(self): 399 def get_partitions(self):
321 return self._partitions 400 return self._partitions
322 401
323# def print_partitions(self): 402# def print_partitions(self):
324# for part in self._partitions.keys(): 403# for part in self._partitions.keys():
325# print self._partitions[part].return_info() 404# print self._partitions[part].return_info()
326 405
406 ##
407 # Brief description of function
408 # @param self Parameter description
327 def print_geometry(self): 409 def print_geometry(self):
328 print self._total_bytes, self._geometry 410 print self._total_bytes, self._geometry
329 411
412 ##
413 # Brief description of function
414 # @param self Parameter description
415 # @param message Parameter description
330 def _error(self, message): 416 def _error(self, message):
331 "Raises an exception" 417 "Raises an exception"
332 raise "DeviceObjectError", message 418 raise "DeviceObjectError", message
333 419
420 ##
421 # Brief description of function
422 # @param self Parameter description
423 # @param cmd Parameter description
334 def _run(self, cmd): 424 def _run(self, cmd):
335 "Runs a command and returns the output" 425 "Runs a command and returns the output"
336 426
337 # Run command 427 # Run command
338 output_string = commands.getoutput(cmd) 428 output_string = commands.getoutput(cmd)
369 _format = None 459 _format = None
370 _resizeable = None 460 _resizeable = None
371 _min_sectors_for_resize = 0 461 _min_sectors_for_resize = 0
372 _mb = 0 462 _mb = 0
373 463
464 ##
465 # Brief description of function
466 # @param self Parameter description
467 # @param device Parameter description
468 # @param minor Parameter description
469 # @param mb Parameter description
470 # @param start Parameter description
471 # @param end Parameter description
472 # @param type Parameter description
473 # @param mountpoint='' Parameter description
474 # @param mountopts='' Parameter description
475 # @param format=True Parameter description
476 # @param existing=False Parameter description
374 def __init__(self, device, minor, mb, start, end, type, mountpoint='', mountopts='', format=True, existing=False): 477 def __init__(self, device, minor, mb, start, end, type, mountpoint='', mountopts='', format=True, existing=False):
375 self._device = device 478 self._device = device
376 self._minor = float(minor) 479 self._minor = float(minor)
377 if existing: self._orig_minor = int(minor) 480 if existing: self._orig_minor = int(minor)
378 self._start = int(start) 481 self._start = int(start)
412 min_size = resize_constraint.min_size 515 min_size = resize_constraint.min_size
413 if int(min_size) != min_size: min_size = int(min_size) + 1 516 if int(min_size) != min_size: min_size = int(min_size) + 1
414 self._min_sectors_for_resize = min_size 517 self._min_sectors_for_resize = min_size
415 self._resizeable = True 518 self._resizeable = True
416 519
520 ##
521 # Brief description of function
522 # @param self Parameter description
417 def is_extended(self): 523 def is_extended(self):
418 if self._type == "extended": 524 if self._type == "extended":
419 return True 525 return True
420 else: 526 else:
421 return False 527 return False
422 528
529 ##
530 # Brief description of function
531 # @param self Parameter description
423 def is_logical(self): 532 def is_logical(self):
424 if self._type == "free": 533 if self._type == "free":
425 if int(self._minor) + Decimal("0.9") == Decimal(str(self._minor)): 534 if int(self._minor) + Decimal("0.9") == Decimal(str(self._minor)):
426 return True 535 return True
427 else: 536 else:
429 elif archinfo[self._device._arch]['extended'] and self._minor > 4: 538 elif archinfo[self._device._arch]['extended'] and self._minor > 4:
430 return True 539 return True
431 else: 540 else:
432 return False 541 return False
433 542
543 ##
544 # Brief description of function
545 # @param self Parameter description
434 def get_logicals(self): 546 def get_logicals(self):
435 if not self.is_extended(): 547 if not self.is_extended():
436 return None 548 return None
437 logicals = [] 549 logicals = []
438 start = self._start 550 start = self._start
442 if part < 5: continue 554 if part < 5: continue
443 logicals.append(part) 555 logicals.append(part)
444 logicals.sort() 556 logicals.sort()
445 return logicals 557 return logicals
446 558
559 ##
560 # Brief description of function
561 # @param self Parameter description
447 def get_extended_parent(self): 562 def get_extended_parent(self):
448 if not self.is_logical(): 563 if not self.is_logical():
449 return None 564 return None
450 else: 565 else:
451 return self._device.get_partition_at(self._start, ignore_extended=0) 566 return self._device.get_partition_at(self._start, ignore_extended=0)
452 567
568 ##
569 # Brief description of function
570 # @param self Parameter description
571 # @param start Parameter description
453 def set_start(self, start): 572 def set_start(self, start):
454 self._start = int(start) 573 self._start = int(start)
455 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512 574 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
456 575
576 ##
577 # Brief description of function
578 # @param self Parameter description
457 def get_start(self): 579 def get_start(self):
458 return int(self._start) 580 return int(self._start)
459 581
582 ##
583 # Brief description of function
584 # @param self Parameter description
585 # @param end Parameter description
460 def set_end(self, end): 586 def set_end(self, end):
461 self._end = int(end) 587 self._end = int(end)
462 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512 588 self._blocks = ((self._end - self._start) * self._device.get_cylinder_size()) / 512
463 589
590 ##
591 # Brief description of function
592 # @param self Parameter description
464 def get_end(self): 593 def get_end(self):
465 return int(self._end) 594 return int(self._end)
466 595
596 ##
597 # Brief description of function
598 # @param self Parameter description
467 def get_mb(self): 599 def get_mb(self):
468 return int(self._mb) 600 return int(self._mb)
469 601
602 ##
603 # Brief description of function
604 # @param self Parameter description
605 # @param mb Parameter description
470 def set_mb(self, mb): 606 def set_mb(self, mb):
471 self._mb = int(mb) 607 self._mb = int(mb)
472 608
609 ##
610 # Brief description of function
611 # @param self Parameter description
612 # @param type Parameter description
473 def set_type(self, type): 613 def set_type(self, type):
474 self._type = type 614 self._type = type
475 615
616 ##
617 # Brief description of function
618 # @param self Parameter description
476 def get_type(self): 619 def get_type(self):
477 return self._type 620 return self._type
478 621
622 ##
623 # Brief description of function
624 # @param self Parameter description
479 def get_device(self): 625 def get_device(self):
480 return self._device 626 return self._device
481 627
628 ##
629 # Brief description of function
630 # @param self Parameter description
631 # @param minor Parameter description
482 def set_minor(self, minor): 632 def set_minor(self, minor):
483 self._minor = float(minor) 633 self._minor = float(minor)
484 634
635 ##
636 # Brief description of function
637 # @param self Parameter description
485 def get_minor(self): 638 def get_minor(self):
486 return float(self._minor) 639 return float(self._minor)
487 640
641 ##
642 # Brief description of function
643 # @param self Parameter description
644 # @param orig_minor Parameter description
488 def set_orig_minor(self, orig_minor): 645 def set_orig_minor(self, orig_minor):
489 self._orig_minor = int(orig_minor) 646 self._orig_minor = int(orig_minor)
490 647
648 ##
649 # Brief description of function
650 # @param self Parameter description
491 def get_orig_minor(self): 651 def get_orig_minor(self):
492 return self._orig_minor 652 return self._orig_minor
493 653
654 ##
655 # Brief description of function
656 # @param self Parameter description
657 # @param mountpoint Parameter description
494 def set_mountpoint(self, mountpoint): 658 def set_mountpoint(self, mountpoint):
495 self._mountpoint = mountpoint 659 self._mountpoint = mountpoint
496 660
661 ##
662 # Brief description of function
663 # @param self Parameter description
497 def get_mountpoint(self): 664 def get_mountpoint(self):
498 return self._mountpoint 665 return self._mountpoint
499 666
667 ##
668 # Brief description of function
669 # @param self Parameter description
670 # @param mountopts Parameter description
500 def set_mountopts(self, mountopts): 671 def set_mountopts(self, mountopts):
501 self._mountopts = mountopts 672 self._mountopts = mountopts
502 673
674 ##
675 # Brief description of function
676 # @param self Parameter description
503 def get_mountopts(self): 677 def get_mountopts(self):
504 return self._mountopts 678 return self._mountopts
505 679
680 ##
681 # Brief description of function
682 # @param self Parameter description
683 # @param format Parameter description
506 def set_format(self, format): 684 def set_format(self, format):
507 self._format = format 685 self._format = format
508 686
687 ##
688 # Brief description of function
689 # @param self Parameter description
509 def get_format(self): 690 def get_format(self):
510 return self._format 691 return self._format
511 692
693 ##
694 # Brief description of function
695 # @param self Parameter description
512 def get_blocks(self): 696 def get_blocks(self):
513 return int(self._blocks) 697 return int(self._blocks)
514 698
699 ##
700 # Brief description of function
701 # @param self Parameter description
515 def get_min_sectors_for_resize(self): 702 def get_min_sectors_for_resize(self):
516 if self.is_extended(): 703 if self.is_extended():
517 min_size = self._start 704 min_size = self._start
518 for part in self._device._partitions: 705 for part in self._device._partitions:
519 if part < 5: continue 706 if part < 5: continue
520 if part.get_end > min_size: min_size = part.get_end() 707 if part.get_end > min_size: min_size = part.get_end()
521 return min_size 708 return min_size
522 else: 709 else:
523 return self._min_sectors_for_resize 710 return self._min_sectors_for_resize
524 711
712 ##
713 # Brief description of function
714 # @param self Parameter description
525 def get_max_sectors_for_resize(self): 715 def get_max_sectors_for_resize(self):
526 free_start, free_end = self._device.get_free_space(self._end) 716 free_start, free_end = self._device.get_free_space(self._end)
527 if free_end == -1: return self._end 717 if free_end == -1: return self._end
528 if free_start - 1 == self._end: 718 if free_start - 1 == self._end:
529 if self.is_logical(): 719 if self.is_logical():
532 else: 722 else:
533 return self._end - self._start 723 return self._end - self._start
534 else: 724 else:
535 return free_end - self._start 725 return free_end - self._start
536 726
727 ##
728 # Brief description of function
729 # @param self Parameter description
730 # @param start Parameter description
731 # @param end Parameter description
537 def resize(self, start, end): 732 def resize(self, start, end):
538 part_at_start = self._device.get_partition_at(int(start)) 733 part_at_start = self._device.get_partition_at(int(start))
539 part_at_end = self._device.get_partition_at(int(end)) 734 part_at_end = self._device.get_partition_at(int(end))
540 logicals = None 735 logicals = None
541 if self.is_logical(): 736 if self.is_logical():
555 return 0 750 return 0
556 self.set_start(start) 751 self.set_start(start)
557 self.set_end(end) 752 self.set_end(end)
558 return 1 753 return 1
559 754
755 ##
756 # Brief description of function
757 # @param self Parameter description
758 # @param message Parameter description
560 def _error(self, message): 759 def _error(self, message):
561 "Raises an exception" 760 "Raises an exception"
562 raise "PartitionObjectError", message 761 raise "PartitionObjectError", message
563 762
564 763

Legend:
Removed from v.508  
changed lines
  Added in v.509

  ViewVC Help
Powered by ViewVC 1.1.20