Hello community,

here is the log from the commit of package dice for openSUSE:Factory checked in 
at 2015-03-18 13:04:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dice (Old)
 and      /work/SRC/openSUSE:Factory/.dice.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dice"

Changes:
--------
--- /work/SRC/openSUSE:Factory/dice/dice.changes        2015-03-05 
18:17:09.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.dice.new/dice.changes   2015-03-18 
13:04:24.000000000 +0100
@@ -1,0 +2,10 @@
+Fri Mar  6 16:49:50 CET 2015 - [email protected]
+
+- Fixed private key handling for buildsystem access
+  
+  vagrant has changed and will create its own key pair when the
+  instance comes up. In order to use the right key dice look up
+  the location of the generated private key and uses that for
+  further ssh connections to the running instance
+  
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dice-0.5.3.gem ++++++
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/connection_host_build_system.rb 
new/lib/connection_host_build_system.rb
--- old/lib/connection_host_build_system.rb     2015-03-04 12:02:37.000000000 
+0100
+++ new/lib/connection_host_build_system.rb     2015-03-06 16:54:28.000000000 
+0100
@@ -1,25 +1,25 @@
 class ConnectionHostBuildSystem < ConnectionBase
-  attr_reader :recipe, :ssh_user, :ssh_host, :ssh_private_key
+  attr_reader :recipe
 
   def initialize(recipe)
     super(recipe)
-    @recipe   = recipe
-    @ssh_user = Dice.config.ssh_user
-    @ssh_host = Dice.config.buildhost
-    @ssh_private_key  = Dice.config.ssh_private_key
+    @recipe = recipe
   end
 
   def ssh
+    ssh_pkey = Dice.config.ssh_private_key
+    ssh_user = Dice.config.ssh_user
+    ssh_host = Dice.config.buildhost
     Dice.logger.info(
       "#{self.class}: ssh into worker for #{recipe.basepath} with \n\
       url: #{ssh_user}@#{ssh_host} \n\
-      key: #{ssh_private_key}"
+      key: #{ssh_pkey}"
     )
     exec(
       [
         "ssh", "-o", "StrictHostKeyChecking=no",
         "-o", "NumberOfPasswordPrompts=0",
-        "-i", ssh_private_key,
+        "-i", ssh_pkey,
         "#{ssh_user}@#{ssh_host}"
       ].join(" ")
     )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/exceptions.rb new/lib/exceptions.rb
--- old/lib/exceptions.rb       2015-03-04 12:02:37.000000000 +0100
+++ new/lib/exceptions.rb       2015-03-06 16:54:28.000000000 +0100
@@ -34,5 +34,6 @@
     class UriStyleMatchFailed < DiceError; end
     class UriTypeUnknown < DiceError; end
     class MountISOFailed < DiceError; end
+    class GetSSHPrivateKeyPathFailed < DiceError; end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/host_build_system.rb new/lib/host_build_system.rb
--- old/lib/host_build_system.rb        2015-03-04 12:02:37.000000000 +0100
+++ new/lib/host_build_system.rb        2015-03-06 16:54:28.000000000 +0100
@@ -1,12 +1,11 @@
 class HostBuildSystem < BuildSystemBase
-  attr_reader :recipe, :host, :user, :ssh_private_key, :basepath
+  attr_reader :recipe, :host, :user, :basepath
 
   def initialize(recipe)
     super(recipe)
     @recipe = recipe
     @host = Dice.config.buildhost
     @user = Dice.config.ssh_user
-    @ssh_private_key = Dice.config.ssh_private_key
     @basepath = @recipe.basepath
   end
 
@@ -35,7 +34,7 @@
       ssh_options = "-o StrictHostKeyChecking=no -o NumberOfPasswordPrompts=0"
       provision_output = Command.run(
         "rsync", "-e",
-        "ssh #{ssh_options} -i #{ssh_private_key}",
+        "ssh #{ssh_options} -i #{get_private_key_path}",
         "--rsync-path", "sudo rsync", "-z", "-a", "-v", "--delete",
         "--exclude", ".*", ".", "#{user}@#{host}:/vagrant",
         :stdout => :capture
@@ -57,7 +56,7 @@
         "ssh",
         "-o", "StrictHostKeyChecking=no",
         "-o", "NumberOfPasswordPrompts=0",
-        "-i", ssh_private_key, "#{user}@#{host}",
+        "-i", get_private_key_path, "#{user}@#{host}",
         "sudo", "killall", "kiwi"
       )
     rescue Cheetah::ExecutionFailed => e
@@ -75,6 +74,10 @@
     host
   end
 
+  def get_private_key_path
+    Dice.config.ssh_private_key
+  end
+
   def is_busy?
     busy = true
     begin
@@ -82,7 +85,7 @@
         "ssh",
         "-o", "StrictHostKeyChecking=no",
         "-o", "NumberOfPasswordPrompts=0",
-        "-i", ssh_private_key, "#{user}@#{host}",
+        "-i", get_private_key_path, "#{user}@#{host}",
         "sudo", "pidof", "-x", "kiwi"
       )
     rescue Cheetah::ExecutionFailed => e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/job.rb new/lib/job.rb
--- old/lib/job.rb      2015-03-04 12:02:37.000000000 +0100
+++ new/lib/job.rb      2015-03-06 16:54:28.000000000 +0100
@@ -1,11 +1,10 @@
 class Job
-  attr_reader :job_user, :job_ssh_private_key
+  attr_reader :job_user
   attr_reader :build_log, :archive, :buildsystem, :ip, :port
 
   def initialize(buildsystem)
     @buildsystem = buildsystem
     @job_user = Dice.config.ssh_user
-    @job_ssh_private_key = Dice.config.ssh_private_key
     @build_log = buildsystem.recipe.basepath + "/" +
       Dice::META + "/" + Dice::BUILD_LOG
     @archive  = buildsystem.recipe.basepath + "/" +
@@ -25,7 +24,7 @@
     begin
       Command.run(
         "ssh", "-o", "StrictHostKeyChecking=no", "-p", port,
-        "-i", job_ssh_private_key, "#{job_user}@#{ip}",
+        "-i", buildsystem.get_private_key_path, "#{job_user}@#{ip}",
         "sudo /usr/sbin/kiwi #{build_opts}",
         :stdout => logfile,
         :stderr => logfile
@@ -49,7 +48,7 @@
     begin
       Command.run(
         "ssh", "-o", "StrictHostKeyChecking=no", "-p", port,
-        "-i", job_ssh_private_key, "#{job_user}@#{ip}",
+        "-i", buildsystem.get_private_key_path, "#{job_user}@#{ip}",
         "sudo /usr/sbin/kiwi #{bundle_opts}",
         :stdout => logfile,
         :stderr => logfile
@@ -71,7 +70,7 @@
     begin
       Command.run(
         "ssh", "-o", "StrictHostKeyChecking=no", "-p", port,
-        "-i", job_ssh_private_key, "#{job_user}@#{ip}",
+        "-i", buildsystem.get_private_key_path, "#{job_user}@#{ip}",
         "sudo tar --exclude image-root -C /tmp/bundle -c .",
         :stdout => result
       )
@@ -94,7 +93,7 @@
     begin
       Command.run(
         "ssh", "-o", "StrictHostKeyChecking=no", "-p", port,
-        "-i", job_ssh_private_key, "#{job_user}@#{ip}",
+        "-i", buildsystem.get_private_key_path, "#{job_user}@#{ip}",
         "sudo rm -rf /tmp/image /tmp/bundle"
       )
     rescue Cheetah::ExecutionFailed => e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant_build_system.rb 
new/lib/vagrant_build_system.rb
--- old/lib/vagrant_build_system.rb     2015-03-04 12:02:37.000000000 +0100
+++ new/lib/vagrant_build_system.rb     2015-03-06 16:54:28.000000000 +0100
@@ -98,6 +98,21 @@
     ip
   end
 
+  def get_private_key_path
+    pkey = nil
+    if ssh_output =~ /Executing SSH.*\-i.*\"(\/.*?)\".*/
+      pkey = $1
+    else
+      if ssh_output.to_s.empty?
+        @ssh_output = "<empty-output>"
+      end
+      raise Dice::Errors::GetSSHPrivateKeyPathFailed.new(
+        "SSH private key retrieval failed no match in ssh output: 
#{ssh_output}"
+      )
+    end
+    pkey
+  end
+
   def is_busy?
     # vagrant VM is never busy, because started by us
     false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2015-03-04 12:02:37.000000000 +0100
+++ new/metadata        2015-03-06 16:54:28.000000000 +0100
@@ -8,7 +8,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-03-04 00:00:00.000000000 Z
+date: 2015-03-06 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: cheetah

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to