rackspace / rack

A CLI for Rackspace (unmaintained)
Other
81 stars 57 forks source link

Rebuild command needs to exclude name from request #387

Closed sigmavirus24 closed 8 years ago

sigmavirus24 commented 8 years ago

I'm using the HEAD of master (presently 7e0867ce8ed27549bf4ccf22822a277540fa4886) and trying to run

$ rack servers instance rebuild --id <server-id> --admin-pass t3stpa55word --image-id 09de0a66-3156-48b4-90a5-1cf25a905207 --log debug

But the client is receiving a 400. I noticed in the debug output that the request body looks like:

{
  "rebuild": {
    "adminPass": "t3stpa55word",
    "imageRef": "09de0a66-3156-48b4-90a5-1cf25a905207",
    "name": ""
  }
}

Which I suspect is why the compute API is returning a 400 Bad Request

If I provide --name <name-of-server> instead of --id <server-id> then the request succeeds.


$ rack version
rack version 1.1.0-beta1-15-g7e0867c
commit: 7e0867ce8ed27549bf4ccf22822a277540fa4886
sigmavirus24 commented 8 years ago

I suspect the fix needs to be somewhere around here but I'm not familiar enough with the library/language conventions to make the patch myself.

jrperritt commented 8 years ago

Ah, thank you. Yes, I see name is added to the request body even when it isn't provided. Try the HEAD of master now. I've just pushed [what I think is] a fix.

sigmavirus24 commented 8 years ago

I'll pull and test this out. Thanks @jrperritt

sigmavirus24 commented 8 years ago

Confirmed it works. :+1: