Fixed: Errno::ENOENT: No such file or directory - /share/tmp

This commit is contained in:
Vokhmin Alexey V 2013-04-24 22:18:03 +04:00
parent 962d8edd52
commit 013bbde7d5
2 changed files with 2 additions and 4 deletions

View File

@ -21,9 +21,7 @@ class KeyPair < ActiveRecord::Base
protected protected
def check_keys def check_keys
tmp = "#{APP_CONFIG['root_path']}/tmp" dir = Dir.mktmpdir('keys-', '/tmp')
system "sudo chown `whoami` #{tmp} && chmod 1777 #{tmp}"
dir = Dir.mktmpdir('keys-', tmp)
begin begin
%w(pubring secring).each do |kind| %w(pubring secring).each do |kind|
filename = "#{dir}/#{kind}" filename = "#{dir}/#{kind}"

View File

@ -22,7 +22,7 @@ class SshKey < ActiveRecord::Base
def set_fingerprint def set_fingerprint
return false unless key return false unless key
file = Tempfile.new('key_file', "#{APP_CONFIG['root_path']}/tmp") file = Tempfile.new('key_file', '/tmp')
filename = file.path filename = file.path
begin begin
file.puts key file.puts key