fix: warn when automation-profile add --update given but no existing profile #10666

Merged
HAL9000 merged 2 commits from fix/v360/automation-profile-update-warning into master 2026-04-28 05:14:06 +00:00
2 changed files with 13 additions and 0 deletions
+7
View File
@@ -20,6 +20,13 @@ Feature: Automation Profile CLI commands
Then the automation-profile add should succeed
And the automation-profile output should contain "Updated"
Scenario: Add profile with --update when profile does not exist warns and creates
Given a valid automation profile config YAML file
When I run automation-profile add with --config and --update
Then the automation-profile add should succeed
And the automation-profile output should contain "Warning"
And the automation-profile output should contain "Profile Added"
Scenario: Add profile conflict without --update
Given a valid automation profile config YAML file
And the custom profile "acme/strict" already exists
@@ -236,6 +236,12 @@ def add_profile(
)
raise typer.Abort()
if update and not existing:
console.print(
f"[yellow]Warning:[/yellow] Profile '{name}' does not exist. "
f"Creating new profile (--update flag has no effect)."
)
if update and existing:
profile = service.update_profile(name, config_data)
title = "Profile Updated"