Commit f68eb2cc authored by Łukasz Nowak's avatar Łukasz Nowak

Minimise modification during slapformat.

parent 379fdc1c
...@@ -89,9 +89,9 @@ for c in context.contentValues(portal_type="Computer Partition"):\n ...@@ -89,9 +89,9 @@ for c in context.contentValues(portal_type="Computer Partition"):\n
existing_partition_dict[c.getReference()] = c\n existing_partition_dict[c.getReference()] = c\n
\n \n
# update computer data\n # update computer data\n
context.edit(\n quantity = len(computer_dict[\'partition_list\'])\n
quantity = len(computer_dict[\'partition_list\']),\n if context.getQuantity() != quantity:\n
)\n context.edit(quantity=quantity)\n
\n \n
compareAndUpdateAddressList(context, [{\'addr\': computer_dict[\'address\'], \'netmask\': computer_dict[\'netmask\']}])\n compareAndUpdateAddressList(context, [{\'addr\': computer_dict[\'address\'], \'netmask\': computer_dict[\'netmask\']}])\n
expected_partition_dict = {}\n expected_partition_dict = {}\n
...@@ -108,6 +108,7 @@ for send_partition in computer_dict[\'partition_list\']:\n ...@@ -108,6 +108,7 @@ for send_partition in computer_dict[\'partition_list\']:\n
\n \n
if partition.getValidationState() == "invalidated":\n if partition.getValidationState() == "invalidated":\n
partition.validate(comment="Reactivated by slapformat")\n partition.validate(comment="Reactivated by slapformat")\n
if partition.getReference() != send_partition[\'reference\']:\n
partition.edit(reference=send_partition[\'reference\'])\n partition.edit(reference=send_partition[\'reference\'])\n
network_interface = send_partition[\'tap\'][\'name\']\n network_interface = send_partition[\'tap\'][\'name\']\n
compareAndUpdateAddressList(partition, send_partition[\'address_list\'], {\'network_interface\': network_interface})\n compareAndUpdateAddressList(partition, send_partition[\'address_list\'], {\'network_interface\': network_interface})\n
......
825 826
\ No newline at end of file \ 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