Commit 5fb78e4c authored by Xavier Thompson's avatar Xavier Thompson

slapconfiguration: Enable <= slap-connection

Introduce alternative names for input parameters to enable

```
[slap-configuration]
<= slap-connection
recipe = slapos.cookbook:slapconfiguration
```

instead of

```
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
```
parent e1e4ed3f
......@@ -52,21 +52,21 @@ class Recipe(object):
For example {"tun": {"ipv4": <addr>}} would be available in buildout as ${instance:tun-ipv4}.
Input:
url
url | server-url
Slap server url.
Example:
${slap-connection:server-url}
key & cert (optional)
key & cert | key-file & cert-file (optional)
Path of files containing key and certificate for secure connection to
slap server.
Example:
${slap-connection:key-file}
${slap-connection:cert-file}
computer
computer | computer-id
Computer identifier.
Example:
${slap-connection:computer-id}
partition
partition | partition-id
Partition identifier.
Example:
${slap-connection:partition-id}
......@@ -129,14 +129,16 @@ class Recipe(object):
2. format.Partition.resource_file - for partition specific details
"""
slap = slapos.slap.slap()
# BBB: or ... (right side) clauses kept for compatibility;
# left-side clauses correspond directly to slap-connection.
slap.initializeConnection(
options['url'],
options.get('key'),
options.get('cert'),
options.get('server-url') or options['url'],
options.get('key-file') or options.get('key'),
options.get('cert-file') or options.get('cert'),
)
computer_partition = slap.registerComputerPartition(
options['computer'],
options['partition'],
options.get('computer-id') or options['computer'],
options.get('partition-id') or options['partition'],
)
parameter_dict = computer_partition.getInstanceParameterDict()
options['instance-state'] = computer_partition.getState()
......
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