The relationship of an identifier specified in the schema is not enforced

Bug #1563517 reported by Sundaresan Rajangam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.0
Fix Committed
Medium
Sachin Bansal
Trunk
Fix Committed
Medium
Sachin Bansal

Bug Description

The following statement in vnc_cfg.xsd describes that a physical-router can be created only with parent identifier "global-system-config"

<xsd:element name="physical-router" type="ifmap:IdentityType"/>
<xsd:element name="global-system-config-physical-router"/>
<!--#IFMAP-SEMANTICS-IDL
     Link('global-system-config-physical-router',
             'global-system-config', 'physical-router', ['has']) -->

However, I could create a physical-router with "domain" as parent identifier

root@nodec39:/usr/lib/python2.7/dist-packages# curl -H "Content-Type: application/json" http://localhost:8082/physical-router/2add9940-9d69-4ab6-bd00-aafca3baf7c0 | python -m json.tool
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 878 100 878 0 0 209k 0 --:--:-- --:--:-- --:--:-- 285k
{
    "physical-router": {
        "display_name": "prouter1",
        "fq_name": [
            "default-domain",
            "prouter1"
        ],
        "href": "http://localhost:8082/physical-router/2add9940-9d69-4ab6-bd00-aafca3baf7c0",
        "id_perms": {
            "created": "2016-03-29T18:35:54.914289",
            "creator": null,
            "description": null,
            "enable": true,
            "last_modified": "2016-03-29T18:35:54.914289",
            "permissions": {
                "group": "cloud-admin-group",
                "group_access": 7,
                "other_access": 7,
                "owner": "cloud-admin",
                "owner_access": 7
            },
            "user_visible": true,
            "uuid": {
                "uuid_lslong": 13619073275223799744,
                "uuid_mslong": 3088793422243908278
            }
        },
        "name": "prouter1",
        "parent_href": "http://localhost:8082/domain/997175e8-448d-4d18-a8fc-04b1cc70e35f",
        "parent_type": "domain",
        "parent_uuid": "997175e8-448d-4d18-a8fc-04b1cc70e35f",
        "perms2": {
            "global_access": 0,
            "owner": null,
            "owner_access": 7,
            "share": []
        },
        "uuid": "2add9940-9d69-4ab6-bd00-aafca3baf7c0"
    }
}

Tags: config
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/18966
Submitter: Sachin Bansal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/18966
Committed: http://github.org/Juniper/contrail-controller/commit/dd062f386a790377aa67d3d24db032279dd1e860
Submitter: Zuul
Branch: master

commit dd062f386a790377aa67d3d24db032279dd1e860
Author: Sachin Bansal <email address hidden>
Date: Thu Mar 31 11:43:53 2016 -0700

Add checks for prop_type and parent types

prop_type is a dictionary in the generated code. Removed the code that
assumed it to be a tuple. Also, added checks for parent type.

Change-Id: Id2228012f60ec6a714263f3f342f98742904c85d
Closes-Bug: 1561253
Closes-Bug: 1563517

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.0

Review in progress for https://review.opencontrail.org/20430
Submitter: Sachin Bansal (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/20430
Committed: http://github.org/Juniper/contrail-controller/commit/e93b2c3597a1ad730a9fe52a8025ac6340e85c8e
Submitter: Zuul
Branch: R3.0

commit e93b2c3597a1ad730a9fe52a8025ac6340e85c8e
Author: Sachin Bansal <email address hidden>
Date: Thu Mar 31 11:43:53 2016 -0700

Add checks for prop_type and parent types

prop_type is a dictionary in the generated code. Removed the code that
assumed it to be a tuple. Also, added checks for parent type.

Change-Id: Id2228012f60ec6a714263f3f342f98742904c85d
Closes-Bug: 1561253
Closes-Bug: 1563517
(cherry picked from commit dd062f386a790377aa67d3d24db032279dd1e860)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.