From 6e7c7820668b20373fa49d5666021c366f92dfa5 Mon Sep 17 00:00:00 2001 From: Vasubabu <3358152+vasubabu@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:46:40 +0530 Subject: [PATCH] fix: For Resetting always_pxe flag --- docs/metal_device_update.md | 2 +- internal/devices/update.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/metal_device_update.md b/docs/metal_device_update.md index 6e65582c..506dd5a9 100644 --- a/docs/metal_device_update.md +++ b/docs/metal_device_update.md @@ -7,7 +7,7 @@ Updates a device. Updates the hostname of a device. Updates or adds a description, tags, userdata, custom data, and iPXE settings for an already provisioned device. Can also lock or unlock future changes to the device. ``` -metal device update -i [-H ] [-d ] [--locked ] [-t ] [-u ] [-c ] [-s ] [--always-pxe] [flags] +metal device update -i [-H ] [-d ] [--locked ] [-t ] [-u ] [-c ] [-s ] [--always-pxe=] [flags] ``` ### Examples diff --git a/internal/devices/update.go b/internal/devices/update.go index 71b342ea..5f33dba6 100644 --- a/internal/devices/update.go +++ b/internal/devices/update.go @@ -44,7 +44,7 @@ func (c *Client) Update() *cobra.Command { ) // updateDeviceCmd represents the updateDevice command updateDeviceCmd := &cobra.Command{ - Use: `update -i [-H ] [-d ] [--locked ] [-t ] [-u ] [-c ] [-s ] [--always-pxe]`, + Use: `update -i [-H ] [-d ] [--locked ] [-t ] [-u ] [-c ] [-s ] [--always-pxe=]`, Short: "Updates a device.", Long: "Updates the hostname of a device. Updates or adds a description, tags, userdata, custom data, and iPXE settings for an already provisioned device. Can also lock or unlock future changes to the device.", Example: ` # Updates the hostname of a device: @@ -74,7 +74,7 @@ func (c *Client) Update() *cobra.Command { deviceUpdate.Tags = tags } - if alwaysPXE { + if cmd.Flag("always-pxe").Changed { deviceUpdate.SetAlwaysPxe(alwaysPXE) }