As part of ths refactor, the code for creating
a tmp_dir has changed.

- ssh is now connections[:ssh]
- the tmp dir should be determined in the install
method, because the path is required by multiple
other methods.

Reviewed-by: Jeff McCune

Signed-off-by: Dan Bode <d...@puppetlabs.com>
---
 lib/puppet/cloudpack.rb |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/puppet/cloudpack.rb b/lib/puppet/cloudpack.rb
index f575418..db7ee9f 100644
--- a/lib/puppet/cloudpack.rb
+++ b/lib/puppet/cloudpack.rb
@@ -491,6 +491,9 @@ module Puppet::CloudPack
       end
       connections = ssh_connect(server, options[:login], options[:keyfile])
 
+      # command for creating cross-ditro tmp dirs
+      options[:tmp_dir] = connections[:ssh].run("bash -c 
'TMP_DIR=/tmp/installer_script.$(echo $RANDOM); mkdir $TMP_DIR; echo 
$TMP_DIR'")[0].stdout.chomp
+
       # This requires the "guid" gem
       certname = Guid.new.to_s
 
@@ -527,9 +530,6 @@ module Puppet::CloudPack
       {:ssh => ssh, :scp => scp}
     end
 
-      # command for creating cross-ditro tmp dirs
-      tmp_dir = ssh.run("bash -c 'TMP_DIR=/tmp/installer_script.$(echo 
$RANDOM); mkdir $TMP_DIR; echo $TMP_DIR'")[0].stdout.chomp
-
       if options[:installer_payload]
         Puppet.notice "Uploading Puppet Enterprise tarball ..."
         scp.upload(options[:installer_payload], "#{tmp_dir}/puppet.tar.gz")
-- 
1.7.5.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to