diff --git a/src/datastore_mad/remotes/rsync/increment_flatten b/src/datastore_mad/remotes/rsync/increment_flatten index c1353bb5ac9..3d867b519ac 100755 --- a/src/datastore_mad/remotes/rsync/increment_flatten +++ b/src/datastore_mad/remotes/rsync/increment_flatten @@ -71,11 +71,11 @@ begin snaps = image.snapshots.first(image.snapshots.size - image.keep_last + 1) - xml = REXML::Document.new(action).root.elements + xml = REXML::Document.new(action).root - base_path = xml['DATASTORE/BASE_PATH'].text - rsync_user = xml['DATASTORE/TEMPLATE/RSYNC_USER']&.text || 'oneadmin' - rsync_host = xml['DATASTORE/TEMPLATE/RSYNC_HOST'].text + base_path = xml.elements['DATASTORE/BASE_PATH'].text + rsync_user = xml.elements['DATASTORE/TEMPLATE/RSYNC_USER']&.text || 'oneadmin' + rsync_host = xml.elements['DATASTORE/TEMPLATE/RSYNC_HOST'].text rescue StandardError => e STDERR.puts e.full_message exit(-1) diff --git a/src/datastore_mad/remotes/rsync/restore b/src/datastore_mad/remotes/rsync/restore index 3192f3e96a4..6e810fee010 100755 --- a/src/datastore_mad/remotes/rsync/restore +++ b/src/datastore_mad/remotes/rsync/restore @@ -77,20 +77,20 @@ begin image = TransferManager::BackupImage.new(action) - xml = REXML::Document.new(action).root.elements + xml = REXML::Document.new(action).root - ds_id = xml['DATASTORE/ID'].text.to_i - base_path = xml['DATASTORE/BASE_PATH'].text - rsync_user = xml['DATASTORE/TEMPLATE/RSYNC_USER']&.text || 'oneadmin' - rsync_host = xml['DATASTORE/TEMPLATE/RSYNC_HOST'].text + ds_id = xml.elements['DATASTORE/ID'].text.to_i + base_path = xml.elements['DATASTORE/BASE_PATH'].text + rsync_user = xml.elements['DATASTORE/TEMPLATE/RSYNC_USER']&.text || 'oneadmin' + rsync_host = xml.elements['DATASTORE/TEMPLATE/RSYNC_HOST'].text rescue StandardError => e STDERR.puts "Missing datastore or image attributes: #{e.message}" exit(-1) end begin - username = xml['TEMPLATE/USERNAME'].text - dst_ds_id = xml['DESTINATION_DS_ID'].text.to_i + username = xml.elements['TEMPLATE/USERNAME'].text + dst_ds_id = xml.elements['DESTINATION_DS_ID'].text.to_i rescue StandardError STDERR.puts 'Cannot find USERNAME / DESTINATION_DS_ID' exit(-1) diff --git a/src/datastore_mad/remotes/rsync/rm b/src/datastore_mad/remotes/rsync/rm index 2720a72d2b9..461bb9660a9 100755 --- a/src/datastore_mad/remotes/rsync/rm +++ b/src/datastore_mad/remotes/rsync/rm @@ -67,11 +67,11 @@ begin image = TransferManager::BackupImage.new action - xml = REXML::Document.new(action).root.elements + xml = REXML::Document.new(action).root - base_path = xml['DATASTORE/BASE_PATH'].text - rsync_user = xml['DATASTORE/TEMPLATE/RSYNC_USER']&.text || 'oneadmin' - rsync_host = xml['DATASTORE/TEMPLATE/RSYNC_HOST'].text + base_path = xml.elements['DATASTORE/BASE_PATH'].text + rsync_user = xml.elements['DATASTORE/TEMPLATE/RSYNC_USER']&.text || 'oneadmin' + rsync_host = xml.elements['DATASTORE/TEMPLATE/RSYNC_HOST'].text rescue StandardError => e STDERR.puts e.full_message exit(-1)