From 569a3166da10675958d9e2f582bd96eb4ea9cae9 Mon Sep 17 00:00:00 2001 From: Callahan Date: Mon, 30 Jan 2023 13:23:38 -0600 Subject: [PATCH] cli: improve docstring for get_build_provider_flags (#4025) Signed-off-by: Callahan Kovacs --- snapcraft_legacy/cli/_options.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/snapcraft_legacy/cli/_options.py b/snapcraft_legacy/cli/_options.py index d0efaaedb7..a0e0ab653b 100644 --- a/snapcraft_legacy/cli/_options.py +++ b/snapcraft_legacy/cli/_options.py @@ -354,9 +354,20 @@ def _param_decls_to_kwarg(key: str) -> str: def get_build_provider_flags(build_provider: str, **kwargs) -> Dict[str, str]: - """Get configured options applicable to build_provider.""" + """Get provider options from kwargs for a build provider. - build_provider_flags: Dict[str, str] = dict() + Boolean options that are false are not collected from kwargs. + Options without an environment variable are not collected from kwargs. + + :param build_provider: Build provider to collect options for. Valid providers are + 'host', 'lxd', 'multipass', and 'managed-host'. + :param kwargs: Dictionary containing provider options. + + :return: Dictionary of provider options with their environment variable as the key. + + :raises RuntimeError: If build provider is invalid. + """ + build_provider_flags: Dict[str, str] = {} # Should not happen - developer safety check. if build_provider not in _ALL_PROVIDERS: