Skip to content

Commit c10a021

Browse files
committed
Fix create config interactive
Do not save a plugin list if none is specified, That way all available plugins can be used. fixes #1265
1 parent 5e2b1f7 commit c10a021

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGES/1265.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed interactive config generation to allow empty plugin list. All availale plugins will be used in that case.

pulp_cli/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import tomli_w
99
from pulp_glue.common.i18n import get_translation
1010

11-
from pulp_cli.generic import HEADER_REGEX, REGISTERED_OUTPUT_FORMATTERS, pulp_group
11+
from pulp_cli.generic import HEADER_REGEX, REGISTERED_OUTPUT_FORMATTERS, _unset, pulp_group
1212

1313
if sys.version_info >= (3, 11):
1414
import tomllib
@@ -256,13 +256,13 @@ def _prompt_config_option(name: str) -> t.Any:
256256
option = next(p for p in ctx.command.params if p.name == name)
257257
if option.multiple:
258258
assert option.type == click.types.STRING
259-
assert option.default is None
259+
assert _unset(option.default)
260260
result = []
261261
value = click.prompt(f"{name} (end with an empty line)", default="", type=option.type)
262262
while value:
263263
result.append(value)
264264
value = click.prompt(f"{name} (continued)", default="", type=option.type)
265-
return result
265+
return None if _unset(result) else result
266266
else:
267267
return click.prompt(name, default=option.default, type=option.type)
268268

0 commit comments

Comments
 (0)