Commit dd57a2cf authored by Xavier Thompson's avatar Xavier Thompson

slap/standalone: Add local SR root parameter

This commit introduces the `local_software_release_root` parameter.
This parameter is then forwarded as the SR root path for slapproxy.
By default the value is `/`, the same as the default in slapproxy.
parent 42ea5ed7
......@@ -211,6 +211,7 @@ class SlapOSConfigWriter(ConfigWriter):
host = {standalone_slapos._server_ip}
port = {standalone_slapos._server_port}
database_uri = {standalone_slapos._proxy_database}
local_software_release_root = {standalone_slapos._local_software_release_root}
{partition_forward_configuration}
""").format(**locals()))
......@@ -318,6 +319,7 @@ class StandaloneSlapOS(object):
shared_part_root=None,
partition_forward_configuration=(),
slapos_bin='slapos',
local_software_release_root=os.sep,
):
# type: (str, str, int, str, Iterable[str], Optional[str], Optional[str], Optional[str], Iterable[Union[PartitionForwardConfiguration, PartitionForwardAsPartitionConfiguration]]) -> None
"""Constructor, creates a standalone slapos in `base_directory`.
......@@ -332,6 +334,7 @@ class StandaloneSlapOS(object):
* `shared_part_root` -- directory to hold shared parts software, default to "shared" in `base_directory`.
* `partition_forward_configuration` -- configuration of partition request forwarding to external SlapOS master.
* `slapos_bin` -- slapos executable to use, default to "slapos" (thus depending on the runtime PATH).
* `local_software_release_root` -- root for local Software Releases paths in the SlapOS proxy, default to `/`.
Error cases:
* `PathTooDeepError` when `base_directory` is too deep. Because of limitation
......@@ -344,6 +347,7 @@ class StandaloneSlapOS(object):
self._server_ip = server_ip
self._server_port = server_port
self._master_url = "http://{server_ip}:{server_port}".format(**locals())
self._local_software_release_root = local_software_release_root
self._base_directory = base_directory
self._shared_part_list = list(shared_part_list)
......
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