server/lib/deltacloud/drivers/vsphere/vsphere_client.rb
# Yield all tasks if they are included in mapper storage directory.
Yield all tasks if they are included in mapper storage directory.
Yield all tasks if they are included in mapper storage directory .
def stored_tasks(datastore, vsphere)
      tasks = VSphere::FileManager::list_mappings(datastore)
      return [] if tasks.empty?
      vsphere.serviceInstance.content.taskManager.recentTask.each do |task|
        if tasks.include?(task.info.key) and ['queued', 'running'].member?(task.info.state)
          yield task
          tasks.delete(task.info.key)
        end
      end
      tasks.select { |f| f =~ /task-(\d+)/ }.each do |task|
        VSphere::FileManager::delete_mapping!(datastore, task)
      end
    end
def stored_tasks ( datastore , vsphere ) tasks = VSphere :: FileManager :: list_mappings ( datastore ) return [ ] if tasks . empty? vsphere . serviceInstance . content . taskManager . recentTask . each do | task | if tasks . include? ( task . info . key ) and [ 'queued' , 'running' ] . member? ( task . info . state ) yield task tasks . delete ( task . info . key ) end end tasks . select { | f | f =~ / task-( \d +) / } . each do | task | VSphere :: FileManager :: delete_mapping! ( datastore , task ) end end
Yield all tasks if they are included in mapper storage directory.
Yield all tasks if they are included in mapper storage directory .
# Delete old left tasks
datastore
<not_specific>
vsphere
<not_specific>