Skip to content

Commit

Permalink
Merge pull request #7 from mackerelio/patch-update-command
Browse files Browse the repository at this point in the history
Fix update command as firstaid
  • Loading branch information
Sixeight committed Jul 4, 2015
2 parents 081bf61 + 0a9399a commit 4a2a905
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,16 @@ func doUpdate(c *cli.Context) {
}

if needUpdateHost {
_, err := client.UpdateHost(hostID, &mkr.UpdateHostParam{
host, err := client.FindHost(hostID)
logger.DieIf(err)
meta := host.Meta
if optName == "" {
optName = host.Name
}
_, err = client.UpdateHost(hostID, &mkr.UpdateHostParam{
Name: optName,
RoleFullnames: optRoleFullnames,
Meta: meta,
})
logger.DieIf(err)
}
Expand Down

0 comments on commit 4a2a905

Please sign in to comment.