Commit db0afb58 authored by Xavier Thompson's avatar Xavier Thompson

format: Support partition capabilities

Computer definition file (slapformat-configuration.cfg) may now have:

```
[partition_0]
...
capability_list =
  fast-network
  more_disk_space
  yet another capability

...
```

Capabilities are line-separated and may otherwise contain whitespace.
Whitespace at the beginning and end of each line is stripped.
parent 988b3fd0
...@@ -1486,6 +1486,15 @@ def parse_computer_definition(conf, definition_path): ...@@ -1486,6 +1486,15 @@ def parse_computer_definition(conf, definition_path):
address_list=address_list, address_list=address_list,
ipv6_range=ipv6_range, ipv6_range=ipv6_range,
tap=tap, tun=tun) tap=tap, tun=tun)
if computer_definition.has_option(section, 'capability_list'):
# Attribute .capability_list exists only when capabilities are defined
capability_string = computer_definition.get(section, 'capability_list')
capability_list = []
for c in capability_string.splitlines():
c = c.strip()
if c:
capability_list.append(c)
partition.capability_list = capability_list
partition_list.append(partition) partition_list.append(partition)
computer.partition_list = partition_list computer.partition_list = partition_list
return computer return computer
......
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