From d34c80c790bd7947422c13b28d3c534da052963e Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Thu, 28 May 2020 16:24:49 +0200 Subject: [PATCH] device creation does not support custom data I got a report from two colleagues about a custom not being able to create a device with custom data. It was a bug in our cli, this PR fixed it. ``` packet-cli device create -f ams1 -H test -P c1.small.x86 -o centos_7 --customdata '{"customdatatest":"heythere"}' -p $PACKET_PROJECT_ID ``` --- cmd/create_device.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/create_device.go b/cmd/create_device.go index 63f663b4..33638712 100644 --- a/cmd/create_device.go +++ b/cmd/create_device.go @@ -76,6 +76,10 @@ packet device create --hostname [hostname] --plan [plan] --facility [facility_co request.UserData = userdata } + if customdata != "" { + request.CustomData = customdata + } + if len(tags) > 0 { request.Tags = tags }