Commit e10c6ea3 authored by Romain Courteaud's avatar Romain Courteaud Committed by Łukasz Nowak

Update validation_state too.

It allows to use catalog for searching.
parent 56059209
......@@ -94,18 +94,31 @@ context.edit(\n
)\n
\n
compareAndUpdateAddressList(context, [{\'addr\': computer_dict[\'address\'], \'netmask\': computer_dict[\'netmask\']}])\n
expected_partition_dict = {}\n
for send_partition in computer_dict[\'partition_list\']:\n
partition = existing_partition_dict.get(send_partition[\'reference\'], None)\n
expected_partition_dict[send_partition[\'reference\']] = True\n
if partition is None:\n
partition = context.newContent(portal_type=\'Computer Partition\')\n
partition.validate()\n
partition.markFree()\n
elif partition.getSlapState() == \'inactive\':\n
# Reactivate partition\n
partition.markFree()\n
partition.markFree(comment="Reactivated by slapformat")\n
\n
if partition.getValidationState() == "invalidated":\n
partition.validate(comment="Reactivated by slapformat")\n
partition.edit(reference=send_partition[\'reference\'])\n
network_interface = send_partition[\'tap\'][\'name\']\n
compareAndUpdateAddressList(partition, send_partition[\'address_list\'], {\'network_interface\': network_interface})\n
\n
# Desactivate all other partitions\n
for key, value in existing_partition_dict.items():\n
if key not in expected_partition_dict:\n
if value.getSlapState() == "free":\n
value.markInactive(comment="Desactivated by slapformat")\n
if value.getValidationState() == "validated":\n
value.invalidate(comment="Desactivated by slapformat")\n
</string> </value>
</item>
<item>
......
790
\ No newline at end of file
791
\ No newline at end of file
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