add_tor_agent_by_id reports KeyError: 'tor_id'

Bug #1506790 reported by Slobodan Blatnjak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
Medium
chhandak
Trunk
Fix Committed
Medium
chhandak

Bug Description

When entered fab add_tor_agent_by_id:X,root@"TSN IP Address" customer is getting following:
 File "/opt/contrail/utils/fabfile/tasks/provision.py", line 1876, in
> add_tor_agent_by_id
> tor_id= int(toragent_dict[host_string][i]['tor_id'])
> KeyError: 'tor_id'

He has 'tor_agent_id' in the testbed file. Because they found that parameter in the "/opt/contrail/utils/fabfile/testbeds/testbed_multibox_example.py" file. But http://www.juniper.net/techpubs/en_US/contrail2.2/topics/concept/using-tor-ovsdb-contrail.html show that 'tor_id' should be used instead. This also seams correct from above error log (KeyError: 'tor_id').
Can you please confirm which one is correct for this case?
Customer would like to understand correct parameter of ToR Agent in testbed.py?

Revision history for this message
Slobodan Blatnjak (sblatnjak) wrote :
Changed in juniperopenstack:
importance: Undecided → Medium
tags: added: bms provisioning
information type: Proprietary → Public
Changed in juniperopenstack:
assignee: nobody → chhandak (chhandak)
Revision history for this message
chhandak (chhandak) wrote :

tor_id parameter here. Sample working configuration given below. Will change the example testbed file as well.

env.tor_agent = {host4:
                     [{
                      'tor_ip':'192.168.11.1',
                      'tor_id':'1',
                      'tor_type':'ovs',
                      'tor_ovs_port':'4321',
                      'tor_ovs_protocol':'pssl',
                      'tor_tsn_ip':'192.168.22.4',
                      'tor_tsn_name':'nodei9',
                      'tor_name':'bng-contrail-qfx51-2',
                      'tor_tunnel_ip':'34.34.34.34',
                      'tor_http_server_port': '5678',
                      'tor_vendor_name':'Juniper'
                      }
                      ]
                      }

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

Review in progress for https://review.opencontrail.org/14702
Submitter: Chhandak Mukherjee (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/14703
Submitter: Chhandak Mukherjee (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/14703
Committed: http://github.org/Juniper/contrail-fabric-utils/commit/14e70e3a0fa80bbe35ae8dab2dbd64ffc17d9d44
Submitter: Zuul
Branch: master

commit 14e70e3a0fa80bbe35ae8dab2dbd64ffc17d9d44
Author: Chhandak <email address hidden>
Date: Thu Oct 29 18:37:09 2015 +0530

In sample testbed for multi box changing key name of tor_agent_id to tor_id

In sample testbed for multi box key name tor_agent_id is wrong. Actually it
should be tor_id.
Closes-Bug: #1506790

Change-Id: Ie692948a11d9db5357e1207773792dd2fefc7a81

Revision history for this message
chhandak (chhandak) wrote :

Modified task add_tor_agent_by_id and delete_tor_agent_by_id. Now this will accept tor_agent_id as key.
Initially the key name was tor_id. Latter we moved it to tor_agent_id. tor_id key is present only for backward compatibility. Please use tor_agent_id for future.

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

Review in progress for https://review.opencontrail.org/14721
Submitter: Chhandak Mukherjee (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/14722
Submitter: Chhandak Mukherjee (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/14722
Committed: http://github.org/Juniper/contrail-fabric-utils/commit/3e35ca5d38b300dcf3e70fc115a029b57a25ee5c
Submitter: Zuul
Branch: R2.20

commit 3e35ca5d38b300dcf3e70fc115a029b57a25ee5c
Author: Chhandak <email address hidden>
Date: Fri Oct 30 10:50:48 2015 +0530

Modify task delete_tor_agent_by_id and add_tor_agent_by_id to support tor_agent_id key.

Modify the delete_tor_agent_by_id and add_tor_agent_by_id to support key tor_agent_id.
Older name for this key was tor_id. Latter we modify the same to tor_agent_id.
Changing the task delete_tor_agent_by_id and add_tor_agent_by_id to support
both the key name.
Closes-bug:#1506790
Change-Id: I3af4a184cf5993d4a2473fb5ce06a928196c51bd

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/14721
Committed: http://github.org/Juniper/contrail-fabric-utils/commit/95cd5e51129c119e8e650ce76363805df61e1d35
Submitter: Zuul
Branch: master

commit 95cd5e51129c119e8e650ce76363805df61e1d35
Author: Chhandak <email address hidden>
Date: Fri Oct 30 10:50:48 2015 +0530

Modify task delete_tor_agent_by_id and add_tor_agent_by_id to support tor_agent_id key.

Modify the delete_tor_agent_by_id and add_tor_agent_by_id to support key tor_agent_id.
Older name for this key was tor_id. Latter we modify the same to tor_agent_id.
Changing the task delete_tor_agent_by_id and add_tor_agent_by_id to support
both the key name.
Closes-bug:#1506790
Change-Id: I3af4a184cf5993d4a2473fb5ce06a928196c51bd

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

Review in progress for https://review.opencontrail.org/15963
Submitter: Vedamurthy Joshi (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/15963
Committed: http://github.org/Juniper/contrail-test/commit/89d204d6ffdefc2650940fa86fc33d2f1a8323f3
Submitter: Zuul
Branch: master

commit 89d204d6ffdefc2650940fa86fc33d2f1a8323f3
Author: Vedu Joshi <email address hidden>
Date: Wed Nov 4 12:00:13 2015 +0530

Add tests for bugs 1466731, 1504710 and other minor changes

* move create_vn(), do_ping_test() and setup_vmi() to neutron base.py
* Remove the workaround due to 1466731 since it is fixed
* In lif_fixture.py, disassociate vmis always
* Bug fix to find out the right active tor agent ip
* In vm_test.py, enhance run_cmd_on_vm() to optionally return fabric’s
_AttributeString instead of returning plain output
* In vm_test.py, Add support to run arbitrary python code
* Add test test_diff_vns_but_same_vxlan_id to validate Bug 1466731
* Add test test_with_fuzz_bug_1504710 to validate bug 1504710 fix
* Accomodate change tor_id -> tor_agent_id as in bug 1506790

Conflicts:
 tcutils/util.py

Change-Id: I594dd48022bfd43a645bd597ec29519e76fcf7c9

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

Review in progress for https://review.opencontrail.org/16082
Submitter: Vedamurthy Joshi (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/16082
Committed: http://github.org/Juniper/contrail-test/commit/17784d8cf030d694b8d276e720a0c3479ce9cf7d
Submitter: Zuul
Branch: R2.20

commit 17784d8cf030d694b8d276e720a0c3479ce9cf7d
Author: Vedu Joshi <email address hidden>
Date: Wed Nov 4 12:00:13 2015 +0530

Add tests for bugs 1466731, 1504710 and other minor changes

* move create_vn(), do_ping_test() and setup_vmi() to neutron base.py
* Remove the workaround due to 1466731 since it is fixed
* In lif_fixture.py, disassociate vmis always
* Bug fix to find out the right active tor agent ip
* In vm_test.py, enhance run_cmd_on_vm() to optionally return fabric’s
_AttributeString instead of returning plain output
* In vm_test.py, Add support to run arbitrary python code
* Add test test_diff_vns_but_same_vxlan_id to validate Bug 1466731
* Add test test_with_fuzz_bug_1504710 to validate bug 1504710 fix
* Accomodate change tor_id -> tor_agent_id as in bug 1506790

Conflicts:
 common/contrail_test_init.py
 fixtures/vm_test.py
 tcutils/util.py

Change-Id: I594dd48022bfd43a645bd597ec29519e76fcf7c9

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.