Commit a52db4e6 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix bug and set the first PTID on the partition table when making it from

scratch.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@658 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 33b3065a
...@@ -30,7 +30,7 @@ class PartitionTable(neo.pt.PartitionTable): ...@@ -30,7 +30,7 @@ class PartitionTable(neo.pt.PartitionTable):
self.id = id self.id = id
def setNextID(self): def setNextID(self):
if self.id == INVALID_PTID: if self.id == protocol.INVALID_PTID:
raise RuntimeError, 'I do not know the last Partition Table ID' raise RuntimeError, 'I do not know the last Partition Table ID'
last_id = unpack('!Q', self.id)[0] last_id = unpack('!Q', self.id)[0]
self.id = pack('!Q', last_id + 1) self.id = pack('!Q', last_id + 1)
...@@ -38,6 +38,8 @@ class PartitionTable(neo.pt.PartitionTable): ...@@ -38,6 +38,8 @@ class PartitionTable(neo.pt.PartitionTable):
def make(self, node_list): def make(self, node_list):
"""Make a new partition table from scratch.""" """Make a new partition table from scratch."""
# start with the first PTID
self.id = pack('!Q', 1)
# First, filter the list of nodes. # First, filter the list of nodes.
node_list = [n for n in node_list \ node_list = [n for n in node_list \
if n.getState() == RUNNING_STATE and n.getUUID() is not None] if n.getState() == RUNNING_STATE and n.getUUID() is not None]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment