test-kitchen / kitchen-digitalocean

A Test Kitchen driver for DigitalOcean

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid Etc.getlogin

someara opened this issue · comments

Hi.

I've ran into this a few times in the past, and have managed to hack around it, but...

The underlying C code in the Ruby class looks at the environment
login = getenv("USER");

This causes problems when running test-kitchen after scrubbing the environment, which is a common (and proper) thing to do when shelling out from $foolang

It's used here...

Etc.getlogin.gsub(/\W/, '')[0..14],

Thanks!

-s

@somera I no longer remember making a fix for this, but apparently I did in other drivers. Would changing it to (Etc.getlogin || 'nologin') like in kitchen-(openstack|rackspace) be sufficient?

Of course, it could go away entirely. It only works this way because I wrote the name generator while on a team of ~10 people who shared one cloud account and could never easily eyeball which servers were whose.

@somera any word on this?

Sorry, got distracted =)

I'd say "sure"... taking queues from other projects makes a lot of sense.
It doesn't really matter at the end of the day, as long as it works

-s

On Fri, Aug 21, 2015 at 6:23 AM, Greg Fitzgerald notifications@github.com
wrote:

@somera https://github.com/somera any word on this?


Reply to this email directly or view it on GitHub
#42 (comment)
.