Comment 3 for bug 907906

Revision history for this message
Brian Lamar (blamar) wrote :

Jay,

I'm not sure we're talking about the same thing here. I understand that specifying a Location property and image data is not a valid use case. However, the way glance was attempting to detect that situation was the incorrect bit.

If you look at the bug report, glance needs to be able to support:

`glance add name=XXX location=YYY`

*when NOT in a TTY*

When we were running "glance add name=XXX location=YYY" without any redirect or piping, glance was failing saying that we shouldn't be giving data AND a location parameter. However, as you can see from the command...no data was being piped in and nothing was being redirected into bin/glance. I was just trying to add an image with a location.

The problem was that Chef was running a bash script in a process WITHOUT a TTY, which is pretty common I'd imagine because creating a pseudo TTY would be a pain/unnecessary. Simply calling `os.isatty` wasn't the correct logic because that would mean you'd always need to be redirecting data when not in a TTY (right?).

The Chef script with adding images w/o data and with a "location" parameter haven't been purposed for merge yet, which might be adding to the confusion here, but I can show you what was failing if I'm not explaining it correctly here. I'm not an expert on TTYs, but I'd like to think this change was correct because "glance add name=XXX location=YYY" should be able to be run when not in a TTY-like environment.