Skip to content

Commit

Permalink
Add proper error message if network type not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Demichev committed Feb 2, 2018
1 parent 6d2e566 commit 9710c9d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ def self.raw_create_cloud_network(ext_management_system, options)
{:ems_ref => network.id, :name => options[:name]}
rescue => e
_log.error "network=[#{options[:name]}], error: #{e}"
raise MiqException::MiqNetworkCreateError, parse_error_message_from_neutron_response(e), e.backtrace
parsed_error = parse_error_message_from_neutron_response(e)
if parsed_error =~ /Invalid input for operation: network_type value '.*' not supported\./
error_message = _("Network type '#{options[:provider_network_type]}' is not supported by the Provider")
else
error_message = parsed_error
end
raise MiqException::MiqNetworkCreateError, error_message, e.backtrace
end

def raw_delete_cloud_network
Expand Down

0 comments on commit 9710c9d

Please sign in to comment.