Comment 4 for bug 907906

Revision history for this message
Jay Pipes (jaypipes) wrote : Re: [Bug 907906] Re: Can't add image with location=XXX when not in TTY

Ah, I gotcha... OK, yes that makes much more sense. Sorry for the
confusion, man! :(

-jay

On Thu, Dec 29, 2011 at 11:48 AM, Brian Lamar <email address hidden> 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.
>
> --
> You received this bug notification because you are subscribed to Glance.
> https://bugs.launchpad.net/bugs/907906
>
> Title:
>  Can't add image with location=XXX when not in TTY
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/glance/+bug/907906/+subscriptions