Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quiet and quietly not always working? #23

Open
mrmarbury opened this issue Jul 19, 2012 · 2 comments
Open

quiet and quietly not always working? #23

mrmarbury opened this issue Jul 19, 2012 · 2 comments

Comments

@mrmarbury
Copy link

Hi, I have a problem with rye on SLES10.

When calling file_exists? it sometimes returns an error when the file does not exist. But since I use quiet mode and the method itself executes quitely, this shouldn't happen, I guess? Since I want to execute an action, if the file does not exist, this is kind of annoying

The Rye versions I've tried so far are 0.9.6 and 0.9.7. The Ruby version is 1.9.3p125

Interesting thing is that it's working with SLES 11 and the exact same versions of ruby and rye.

The way I'm using it is this:

if ssh.file_exists? config_file + "." + suffix
  false
else
  true
end

When calling Rye::Box.new, I'm setting quiet: true

Maybe you have an idea?

Thx alot,
Stefan

@mrmarbury
Copy link
Author

I digged some more and found out the following ... It doesn't return an error, it just returns true

Here's a sequence of executions in irb that shows what's weird:

ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL: No such file or directory
=> true

irb(main):047:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL: No such file or directory
=> true

irb(main):048:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL: No such file or directory
=> true

irb(main):049:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: => false

irb(main):050:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: => false

irb(main):051:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL
=> false

irb(main):052:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL
=> false

irb(main):053:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL: No such file or directory
=> true

irb(main):054:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL
=> false

irb(main):055:0> ssh.file_exists? '/etc/apache/vhosts.d/config-ssl.conf.ORIGINAL'
ls: /etc/apache/vhosts.d/config-ssl.conf.ORIGINAL: No such file or directory
=> true

The file is definitely not existing on the system.

@delano
Copy link
Owner

delano commented Sep 19, 2012

Thanks for the report. The file_* commands have some funky code to work around some challenges in net-ssh/net-sftp. I'll take a look in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants