Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim Volume error messages out of Fog responses #123

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ManageIQ::Providers::Openstack::CloudManager::CloudVolume < ::CloudVolume
include ManageIQ::Providers::Openstack::HelperMethods
include_concern 'Operations'

include SupportsFeatureMixin
Expand All @@ -25,7 +26,7 @@ def self.raw_create_volume(ext_management_system, options)
{:ems_ref => volume.id, :status => volume.status, :name => options[:name]}
rescue => e
_log.error "volume=[#{options[:name]}], error: #{e}"
raise MiqException::MiqVolumeCreateError, e.to_s, e.backtrace
raise MiqException::MiqVolumeCreateError, parse_error_message_from_fog_response(e), e.backtrace
end

def validate_update_volume
Expand All @@ -39,7 +40,7 @@ def raw_update_volume(options)
end
rescue => e
_log.error "volume=[#{name}], error: #{e}"
raise MiqException::MiqVolumeUpdateError, e.to_s, e.backtrace
raise MiqException::MiqVolumeUpdateError, parse_error_message_from_fog_response(e), e.backtrace
end

def validate_delete_volume
Expand All @@ -55,7 +56,7 @@ def raw_delete_volume
with_provider_object(&:destroy)
rescue => e
_log.error "volume=[#{name}], error: #{e}"
raise MiqException::MiqVolumeDeleteError, e.to_s, e.backtrace
raise MiqException::MiqVolumeDeleteError, parse_error_message_from_fog_response(e), e.backtrace
end

def backup_create(options)
Expand All @@ -66,7 +67,7 @@ def backup_create(options)
end
rescue => e
_log.error "backup=[#{name}], error: #{e}"
raise MiqException::MiqVolumeBackupCreateError, e.to_s, e.backtrace
raise MiqException::MiqVolumeBackupCreateError, parse_error_message_from_fog_response(e), e.backtrace
end

def backup_create_queue(userid, options = {})
Expand All @@ -92,7 +93,7 @@ def backup_restore(backup_id)
end
rescue => e
_log.error "volume=[#{name}], error: #{e}"
raise MiqException::MiqVolumeBackupRestoreError, e.to_s, e.backtrace
raise MiqException::MiqVolumeBackupRestoreError, parse_error_message_from_fog_response(e), e.backtrace
end

def backup_restore_queue(userid, backup_id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ManageIQ::Providers::Openstack::CloudManager::CloudVolumeBackup < ::CloudVolumeBackup
include ManageIQ::Providers::Openstack::HelperMethods
include SupportsFeatureMixin

supports :delete
Expand All @@ -10,7 +11,7 @@ def raw_restore(volumeid)
end
rescue => e
_log.error("backup=[#{name}], error: #{e}")
raise MiqException::MiqOpenstackApiRequestError, e.to_s, e.backtrace
raise MiqException::MiqOpenstackApiRequestError, parse_error_message_from_fog_response(e), e.backtrace
end

def raw_delete
Expand All @@ -19,7 +20,7 @@ def raw_delete
end
rescue => e
_log.error("volume backup=[#{name}], error: #{e}")
raise MiqException::MiqOpenstackApiRequestError, e.to_s, e.backtrace
raise MiqException::MiqOpenstackApiRequestError, parse_error_message_from_fog_response(e), e.backtrace
end

def with_provider_object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ManageIQ::Providers::Openstack::CloudManager::CloudVolumeSnapshot < ::CloudVolumeSnapshot
include ManageIQ::Providers::Openstack::HelperMethods
include SupportsFeatureMixin

supports :create
Expand Down Expand Up @@ -56,7 +57,7 @@ def self.create_snapshot(cloud_volume, options = {})
)
rescue => e
_log.error "snapshot=[#{options[:name]}], error: #{e}"
raise MiqException::MiqVolumeSnapshotCreateError, e.to_s, e.backtrace
raise MiqException::MiqVolumeSnapshotCreateError, parse_error_message_from_fog_response(e), e.backtrace
end

def update_snapshot_queue(userid = "system", options = {})
Expand Down Expand Up @@ -88,7 +89,7 @@ def update_snapshot(options = {})
end
rescue => e
_log.error "snapshot=[#{name}], error: #{e}"
raise MiqException::MiqVolumeSnapshotUpdateError, e.to_s, e.backtrace
raise MiqException::MiqVolumeSnapshotUpdateError, parse_error_message_from_fog_response(e), e.backtrace
end

def delete_snapshot_queue(userid = "system", _options = {})
Expand Down Expand Up @@ -120,7 +121,7 @@ def delete_snapshot(_options = {})
end
rescue => e
_log.error "snapshot=[#{name}], error: #{e}"
raise MiqException::MiqVolumeSnapshotDeleteError, e.to_s, e.backtrace
raise MiqException::MiqVolumeSnapshotDeleteError, parse_error_message_from_fog_response(e), e.backtrace
end


Expand Down