diff --git a/src/datastore_mad/remotes/rsync/backup b/src/datastore_mad/remotes/rsync/backup index 48f9ed2111..0b08e267be 100755 --- a/src/datastore_mad/remotes/rsync/backup +++ b/src/datastore_mad/remotes/rsync/backup @@ -85,7 +85,7 @@ end path = Pathname.new(base).cleanpath.to_s -backup_id = "#{SecureRandom.hex[0, 6]}" +backup_id = SecureRandom.hex[0, 6].to_s backup_path = "#{path}/#{vmid}/#{backup_id}/" #------------------------------------------------------------------------------- diff --git a/src/datastore_mad/remotes/rsync/restore b/src/datastore_mad/remotes/rsync/restore index b417b537f8..03afefe445 100755 --- a/src/datastore_mad/remotes/rsync/restore +++ b/src/datastore_mad/remotes/rsync/restore @@ -85,7 +85,7 @@ begin rsync_host = rds.elements['DATASTORE/TEMPLATE/RSYNC_HOST'].text rsync_user = rds.elements['DATASTORE/TEMPLATE/RSYNC_USER'].text vm_id = rds.elements['IMAGE/VMS[1]/ID'].text.to_i - image = TransferManager::BackupImage.new(drv_action) + image = TransferManager::BackupImage.new(drv_action) rescue StandardError => e STDERR.puts "Missing datastore or image attributes: #{e.message}" exit(1) @@ -177,7 +177,6 @@ br_disks = restorer.disk_images(disks) one_error = '' images = [] - # Create disk images br_disks.each do |_id, disk| # Fix image name - maybe not necessary any longer diff --git a/src/datastore_mad/remotes/rsync/stat b/src/datastore_mad/remotes/rsync/stat index 409cfcd5be..774659039d 100755 --- a/src/datastore_mad/remotes/rsync/stat +++ b/src/datastore_mad/remotes/rsync/stat @@ -68,7 +68,7 @@ _ds_id = ARGV[1] # base path = /var/lib/one//datastores/100/13 begin - rds = REXML::Document.new(Base64::decode64(daction64)).root.elements + rds = REXML::Document.new(Base64.decode64(daction64)).root.elements img = rds['/DS_DRIVER_ACTION_DATA/IMAGE/PATH'].text rsync_host = rds['/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RSYNC_HOST'].text rsync_user = rds['/DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RSYNC_USER'].text @@ -88,9 +88,8 @@ begin last_snap = parts[1].split(',')[-1].split(':')[-1] cmd = "cat #{base_path}#{last_snap}/vm.xml" - -rescue StandardError => se - STDERR.puts se.message +rescue StandardError => e + STDERR.puts e.message exit(1) end @@ -106,7 +105,7 @@ if rc.code != 0 exit(1) end -vm = REXML::Document.new(Base64::decode64(rc.stdout)).root +vm = REXML::Document.new(Base64.decode64(rc.stdout)).root xpath = "/VM/TEMPLATE/DISK[ DISK_ID = #{diskid[1]} ]/SIZE"