Bug 881023 - storage: cannot create partitions outside transaction
Summary: storage: cannot create partitions outside transaction
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: David Lehman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-28 12:57 UTC by Jan Safranek
Modified: 2013-04-12 11:35 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-04-12 11:35:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dlehman's patch (954 bytes, application/force-download)
2012-11-28 12:57 UTC, Jan Safranek
no flags Details

Description Jan Safranek 2012-11-28 12:57:42 UTC
Created attachment 653486 [details]
dlehman's patch

Sometime ago I discussed with David Lehman how to create several partitions without transaction management in Anaconda.

I want is this to work:

def createPartition(storage):
    part1 = storage.newPartition(disks=[disk], size=100, grow=False)
    action1 = pyanaconda.storage.deviceaction.ActionCreateDevice(part1)
    storage.devicetree.registerAction(action1)
    pyanaconda.storage.partitioning.doPartitioning(storage=storage)
    disk.format.resetPartedDisk()
    action1.execute()

If I run this function once, it works as expected and creates one partition. If I run it twice, the second call raises:

  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/deviceaction.py", line 241, in execute
    self.device.create()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devices.py", line 787, in create
    raise DeviceCreateError(str(e), self.name)
DeviceCreateError: ("Can't have overlapping partitions.", 'sdc3')

We agreed with David on some preliminary patch(attached), which solves the issue with disk.format.resetPartedDisk(). But the patch did not went to Anaconda upstream.


Version-Release number of selected component (if applicable):
anaconda-18.28-1.fc18.x86_64

Comment 1 David Lehman 2013-02-05 23:18:02 UTC
This should be fixed by commit bd40ab4eec434a.

Comment 2 Jan Safranek 2013-04-12 11:35:32 UTC
I haven't tested it, I use transactions now.


Note You need to log in before you can comment on or make changes to this bug.