Re: Cannot add a partition after devicetree.processActions()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-03-27 at 08:06 -0500, David Lehman wrote:
> Since you are apparently going to be performing one action at a time,
> there is no need for you to use processActions. It's main purpose is to
> execute a potentially long series of actions. You should just create the
> actions yourself and then directly execute them as follows:
> 
> part1 = storage.newPartition(disks=[disk], size=10)
> action1 = pyanaconda.storage.deviceaction.ActionCreateDevice(part1)
> storage.devicetree.registerAction(action1)

I forgot to add the call to doPartitioning here:

pyanaconda.storage.partitioning.doPartitioning(storage=storage)

> action1.execute()
> 
> part2 = storage.newPartition(disks=[disk])
> action2 = pyanaconda.storage.deviceaction.ActionCreateDevice(part2)
> storage.devicetree.registerAction(action2)

Likewise here:

pyanaconda.storage.partitioning.doPartitioning(storage=storage)

> action2.execute()
> 
> > >>
> > >> Is the above code valid or really only one processActions() is allowed?
> > > 
> > > It is not designed specifically to allow multiple calls to
> > > processActions. However, it should require little more than a single
> > > line of code to clear the action list before creating the second set of
> > > devices. For now we can't clear the action list automatically because it
> > > is used later to aid in writing anaconda-ks.cfg. This will probably
> > > change in F18.
> > > 
> > > Try adding the following right after each processActions call:
> > > 
> > > storage.devicetree._actions = []
> > 
> > 2nd storage.devicetree.processActions(dryRun=False):
> > DeviceCreateError: ("Can't have overlapping partitions.", 'sda2')
> > 
> > Weird, pyanaconda.storage.partitioning.doPartitioning() allocates part2
> > correctly, it does not overlap anything:
> > 
> > part1.partedPartition.geometry: start: 2048  end: 22527
> > part2.partedPartition.geometry: start: 22528 end: 1046527
> > 
> > storage.devicetree._actions = [] is not enough.
> 
> Yes, I forgot about some of the details of the queuing of actions.
> 
> > 
> > Jan
> > 
> > _______________________________________________
> > Anaconda-devel-list mailing list
> > Anaconda-devel-list@xxxxxxxxxx
> > https://www.redhat.com/mailman/listinfo/anaconda-devel-list
> 
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux