A bit the same way we ignore drushrc files we can't open, we should do the same with aliases, with a little twist: I believe we shouldn't give a warning at all. There can be many different aliases all over the place, some may be in your search path, but maybe you shouldn't have access to them, and rightly so. You don't want to be harrassed by drush warning you that you can't open them.

Right now I have this phenomenon:

anarcat@marcos:provisionacl$ env HOME=/var/aegir drush @test.orangeseeds.org status
include(/home/aegir/.drush/server_localhost.alias.drushrc.php): failed to open stream: Permission denied   [warning]
sitealias.inc:433
include(): Failed opening '/var/aegir/.drush/server_localhost.alias.drushrc.php' for inclusion             [warning]
(include_path='.:/usr/share/php:/usr/share/pear') sitealias.inc:433

At least if we had only one warning, things would be better. :)

I propose that we just silently skip such aliases, for my sanity.

Comments

anarcat’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Patch is attached. I can push this to master whenever you guys want.

Could this be merged in 4.x too? ;)

moshe weitzman’s picture

Status: Needs review » Active

I think a drush_log('cannot open foo', 'warning') would be about right. I could do 'debug' if others prefer that.

anarcat’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

Done with bootstrap.

msonnabaum’s picture

I'm good with #3.

greg.1.anderson’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

msonnabaum’s picture

Status: Reviewed & tested by the community » Fixed

Committed to master/4.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.