Bug 1529104 - [UI] Generic error in adding duplicate subnet should be changed to specific error
Summary: [UI] Generic error in adding duplicate subnet should be changed to specific e...
Keywords:
Status: CLOSED DUPLICATE of bug 1529108
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.9.0
Assignee: Alona Kaplan
QA Contact: Mor
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-26 11:18 UTC by Mor
Modified: 2018-01-08 14:59 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-07 14:34:31 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
logs (988.04 KB, application/octet-stream)
2017-12-26 11:18 UTC, Mor
no flags Details

Description Mor 2017-12-26 11:18:11 UTC
Created attachment 1372417 [details]
logs

Description of problem:
When trying to add a router interface with subnet that is already attached to that router, CFME UI throws a generic error message: "Unable to add Subnet "test_router": undefined method `[]' for nil:NilClass".

Version-Release number of selected component (if applicable):
CFME 5.9.0.12.20171205180333_3e32b3d 
ovirt-provider-ovn-1.2.2-1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create cloud router.
2. Create cloud subnet.
3. Add router interface with subnet from step 2.
4. Redo step 3.

Actual results:
UI Exception: "Unable to add Subnet "test_router": undefined method `[]' for nil:NilClass"

Expected results:
UI Error should be something like "Subnet: <NAME> is already connected to this router"

Additional info:
ovirt-provider-ovn.log:
2017-12-26 12:04:14,460   Can not add subnet 8cf8ae96-5bc8-4e91-8336-8de1f6708d0e to router 8c1d2ba2-9aff-40ca-a5e2-e74e27de4f71. Subnet is already connected to this router
Traceback (most recent call last):
  File "/usr/share/ovirt-provider-ovn/handlers/base_handler.py", line 126, in _handle_request
    method, path_parts, content)
  File "/usr/share/ovirt-provider-ovn/handlers/selecting_handler.py", line 176, in handle_request
    return self.call_response_handler(handler, content, parameters)
  File "/usr/share/ovirt-provider-ovn/handlers/neutron.py", line 36, in call_response_handler
    return response_handler(ovn_north, content, parameters)
  File "/usr/share/ovirt-provider-ovn/handlers/neutron_responses.py", line 230, in put_add_router_inerface
    get_entity(content), parameters[ROUTER_ID]
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 58, in wrapper
    return (f(wrapped_self, rest_data, entity_id) if entity_id
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 42, in wrapper
    return cls.rest2row(wrapped_self, f, rest_data, entity_id)
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 493, in rest2row
    wrapped_self, router_id=router_id, subnet_id=subnet, port_id=port
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 66, in wrapper
    data = f(wrapped_self, *args, **kwargs)
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north.py", line 814, in add_router_interface
    if subnet_id else
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north.py", line 769, in _create_routing_lsp_by_subnet
    subnet_id, subnet, router_id, network_id)
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north.py", line 753, in _validate_create_routing_lsp_by_subnet
    subnet=subnet_id, router=router_id
BadRequestError: Can not add subnet 8cf8ae96-5bc8-4e91-8336-8de1f6708d0e to router 8c1d2ba2-9aff-40ca-a5e2-e74e27de4f71. Subnet is already connected to this router

Comment 2 Alona Kaplan 2018-01-07 14:34:31 UTC
Once bug #1529108 would be fixed, there would be no possibility to add the same subnet twice to the same interface via the ui.

*** This bug has been marked as a duplicate of bug 1529108 ***


Note You need to log in before you can comment on or make changes to this bug.