Skip to content

Commit 24a8e3a

Browse files
authored
Fix duration in cli.create (#86)
2 parents ff7e3f1 + 2117712 commit 24a8e3a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/frequenz/client/dispatch/__main__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ async def cli(ctx: click.Context, url: str, key: str) -> None:
5858
if ctx.obj is None:
5959
ctx.obj = {}
6060

61+
click.echo(f"Using API URL: {url}", err=True)
62+
6163
ctx.obj["client"] = Client(
6264
server_url=url,
6365
key=key,
@@ -264,6 +266,10 @@ async def create(
264266
# Remove keys with `None` value
265267
kwargs = {k: v for k, v in kwargs.items() if v is not None}
266268

269+
# Required for client.create
270+
if not kwargs.get("duration"):
271+
kwargs["duration"] = None
272+
267273
dispatch = await ctx.obj["client"].create(
268274
recurrence=parse_recurrence(kwargs),
269275
**kwargs,

0 commit comments

Comments
 (0)