diff options
author | elijah <elijah@riseup.net> | 2013-01-30 21:51:16 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-01-30 21:51:16 -0800 |
commit | e13b80913f84a1d6154d7506d27d875e3b3cd239 (patch) | |
tree | fd022f71e1013e11c142a9feee7f16bebaeece0e /lib | |
parent | f1c63c766015b1644ca8cfb08067c562f6b375fa (diff) | |
download | leap_cli-e13b80913f84a1d6154d7506d27d875e3b3cd239.tar.gz leap_cli-e13b80913f84a1d6154d7506d27d875e3b3cd239.tar.bz2 |
fix problem with nested Dir.chdir
Diffstat (limited to 'lib')
-rw-r--r-- | lib/leap_cli/remote/plugin.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/leap_cli/remote/plugin.rb b/lib/leap_cli/remote/plugin.rb index c32b0be..38705a9 100644 --- a/lib/leap_cli/remote/plugin.rb +++ b/lib/leap_cli/remote/plugin.rb @@ -21,7 +21,6 @@ module LeapCli; module Remote; module Plugin end def assert_initialized - begin test_initialized_file = "test -f /srv/leap/initialized" check_required_packages = "! dpkg-query -W --showformat='${Status}\n' #{required_packages} 2>&1 | grep -q -E '(deinstall|no packages)'" @@ -78,11 +77,11 @@ module LeapCli; module Remote; module Plugin ) # run command + chdir = options[:chdir] || Path.provider + rsync_cmd = "cd #{chdir}; #{rsync_cmd}" logger.debug rsync_cmd - Dir.chdir(options[:chdir] || Path.provider) do - ok = system(rsync_cmd) - failed_servers << server.host unless ok - end + ok = system(rsync_cmd) + failed_servers << server.host unless ok end raise "rsync failed on #{failed_servers.join(',')}" if failed_servers.any? |