Skip to content

Commit

Permalink
fix: For Resetting always-pxe flag (#367)
Browse files Browse the repository at this point in the history
# Description :

This PR  fixes the issue #257
  • Loading branch information
displague authored Oct 18, 2023
2 parents 3b16c85 + 6e7c782 commit a64058f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/metal_device_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe] [flags]
metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>] [flags]
```

### Examples
Expand Down
4 changes: 2 additions & 2 deletions internal/devices/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *Client) Update() *cobra.Command {
)
// updateDeviceCmd represents the updateDevice command
updateDeviceCmd := &cobra.Command{
Use: `update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe]`,
Use: `update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>]`,
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:
Expand Down Expand Up @@ -74,7 +74,7 @@ func (c *Client) Update() *cobra.Command {
deviceUpdate.Tags = tags
}

if alwaysPXE {
if cmd.Flag("always-pxe").Changed {
deviceUpdate.SetAlwaysPxe(alwaysPXE)
}

Expand Down

0 comments on commit a64058f

Please sign in to comment.