utils: net_policy_join.py script is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Juniper Openstack |
Fix Committed
|
Undecided
|
Hampapur Ajay |
Bug Description
Reported by Aki-san:
Hello Experts,
I had a query from one of our partner asking for how to create and assign policy to existing virtual networks from CLI.
I found /opt/contrail/ net_policy_join.py and tested by running it alone from linux command prompt. It did not work with contrail 1.2 Icehouse environment.
Correct me if I am wrong but the below is the change I made to avoid errors.
Error indicates the policy name contains characters that is not allowed.
In the following line, get_fq_name_str() returns ‘:’ separated fqn and it causes the error.
'policy-%s-%s-any' % (net1.get_
So, I took only network name part like below.
net1.get_
The next issue is what I am not confident at all because I ran it alone from linux prompt by providing network UUID, not called from other python program that contains contrail project information.
After fixing the above, found one more issue that the policy was created in default-
It is because
pol1 = vnc_api.
does not provide domain as its parameter.
So, I added it like below and it worked fine finally.
pol1 = vnc_api.
'policy-
It looks ok though, but I am not confident since I am very new to API and even python, so would like to ask experts for verification.
Best Regards,
Aki
Changed in juniperopenstack: | |
assignee: | nobody → Hampapur Ajay (hajay) |
Reviewed: https:/ /review. opencontrail. org/5979 github. org/Juniper/ contrail- controller/ commit/ 055238c4475064c b4c1204c55ba2d9 bf12b1cc83
Committed: http://
Submitter: Zuul
Branch: master
commit 055238c4475064c b4c1204c55ba2d9 bf12b1cc83
Author: Hampapur Ajay <email address hidden>
Date: Wed Dec 31 23:18:09 2014 -0800
Fix script to deal with multi-tenancy and use just net names in policy.
Assumes net1/net2 are in same project.
Change-Id: I84fd054fafae01 8837ecd2609d677 a410c363e53
Closes-Bug: #1406857