Class: Migratio::Worker::OpenstackOpenstackMigrator

Inherits:
Migrator
  • Object
show all
Defined in:
lib/migratio/worker/openstack_openstack_migrator.rb

Instance Method Summary collapse

Methods inherited from Migrator

#perform

Instance Method Details

#perform_action(image_uuid, compute_site) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/migratio/worker/openstack_openstack_migrator.rb', line 7

def perform_action(image_uuid, compute_site)
  dir = File.dirname(__FILE__)
  output = `#{dir}/../../../scripts/openstack2openstack-transfer.sh "#{image_uuid}" "#{dir}/../../../config/#{compute_site}.conf"`
  Sidekiq::Client.push(
    'queue' => 'feedback',
    'class' => 'Atmosphere::UpdateMigrationJobStatusWorker',
    'args' => [image_uuid, config.name, compute_site, output])
  if $?.exitstatus == 1
    return
  end

  output = `#{dir}/../../../scripts/openstack2openstack-register.sh "#{image_uuid}" "#{dir}/../../../config/#{compute_site}.conf"`
  Sidekiq::Client.push(
    'queue' => 'feedback',
    'class' => 'Atmosphere::UpdateMigrationJobStatusWorker',
    'args' => [image_uuid, config.name, compute_site, output])
end