Skip to content

Commit 3cbebf1

Browse files
Pawel Zadroznypawelzny
authored andcommitted
Revert "[config] Routing Policy simple color identifier"
This reverts commit cf6e43f. Reason for revert: <INSERT REASONING HERE> Change-Id: I01fe007140c2178d53e3801d679749a6e3debd01
1 parent 9a4c944 commit 3cbebf1

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/config/api-server/vnc_cfg_api_server/api_server.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,14 @@ def _validate_communityattribute_type(cls, value):
360360
if value in poss_values:
361361
return
362362

363-
res = re.match('^(color:|0x030b:)?[0-9]{1,5}:[0-9]{1,10}$', value)
363+
res = re.match('[0-9]+:[0-9]+', value)
364364
if res is None:
365365
raise ValueError('Invalid community format %s. '
366366
'Change to \'number:number\''
367-
'or extended format color:number:number'
368-
% value)
367+
% value)
369368

370-
community = value.split(':')
371-
asn = community[-2]
372-
if int(asn) > 65535:
369+
asn = value.split(':')
370+
if int(asn[0]) > 65535:
373371
raise ValueError('Out of range ASN value %s. '
374372
'ASN values cannot exceed 65535.'
375373
% value)

src/config/api-server/vnc_cfg_api_server/tests/resources/test_routing_policy.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
import cfgm_common
99
from testtools import ExpectedException
10-
from vnc_api.vnc_api import ActionCommunityType, ActionUpdateType
11-
from vnc_api.vnc_api import CommunityListType
1210
from vnc_api.vnc_api import InterfaceRouteTable
1311
from vnc_api.vnc_api import PolicyStatementType, PolicyTermType
1412
from vnc_api.vnc_api import PrefixListMatchType
@@ -243,22 +241,4 @@ def test_routing_policy_for_network_device(self):
243241
self._vnc_lib.routing_policy_delete(id=rp_uuid)
244242
# end test_routing_policy_for_network_device
245243

246-
def test_routing_policy_community_target(self):
247-
rp = RoutingPolicy(name=self.id(), term_type='network-device')
248-
rp.set_routing_policy_entries(PolicyStatementType(term=[
249-
PolicyTermType(
250-
term_match_condition=TermMatchConditionType(),
251-
term_action_list=TermActionListType(
252-
action='accept',
253-
update=ActionUpdateType(
254-
community=ActionCommunityType(
255-
add=CommunityListType(community=['color:30:12345',
256-
'30:1234556890',
257-
'0x030b:1:1'])
258-
)))),
259-
]))
260-
self._vnc_lib.routing_policy_create(rp)
261-
self.assertIsNotNone(rp.uuid)
262-
# end test_routing_policy_community_target
263-
264244
# end TestRoutingPolicy

0 commit comments

Comments
 (0)