Conversation
|
@cbpaviz |
|
/azpw run |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 1887 in repo Azure/sonic-utilities |
|
/azpw run |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@cbpaviz Could you help to review again, I merged the code from master branch due to some confict. |
|
/azpw run |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@cbpaviz |
|
@cbpaviz Could you help to review again, I merged the code from master branch due to some conflict. |
|
@superchild , why SAG config commands are different compare to EC config commands (available in their config guid). is it intentional ? |
|
@kulpatel, this PR is discussed and reviewed by community, EC will also follow the same design after this merged. |
config/main.py
Outdated
| @mac_address.command('del') | ||
| @click.argument('mac_address', metavar='<mac_address>', required=True, type=str) | ||
| @clicommon.pass_db | ||
| def del_mac(db, mac_address): |
There was a problem hiding this comment.
Since only one mac address is allowed. mac_address is not a useful argument here.
config/vlan.py
Outdated
| # We need to restart dhcp_relay service after dhcpv6_relay config change | ||
| dhcp_relay_util.handle_restart_dhcp_relay_service() | ||
|
|
||
| keys = [ (k, v) for k, v in db.cfgdb.get_table('VLAN_MEMBER') if k == 'Vlan{}'.format(vid) ] |
There was a problem hiding this comment.
is this change related to this feature?
config/vlan.py
Outdated
| if not clicommon.is_valid_vlan_interface(db.cfgdb, vlan): | ||
| ctx.fail(f"Interface {vlan} does not exist") | ||
|
|
||
| db.cfgdb.mod_entry('VLAN_INTERFACE', vlan, {"static_anycast_gateway": "true"}) |
There was a problem hiding this comment.
do we need check whether static_anycast_gateway has already been configured?
config/main.py
Outdated
| sag_entry = db.cfgdb.get_entry('SAG', 'GLOBAL') | ||
| if sag_entry: | ||
| if sag_entry.get('gateway_mac').lower() == mac_address.lower(): | ||
| db.cfgdb.mod_entry('SAG', 'GLOBAL', None) |
There was a problem hiding this comment.
do we need disable sag for each vlan?
There was a problem hiding this comment.
This is handled in sonic-swss.
config/vlan.py
Outdated
|
|
||
| log.log_info(f"'vlan static-anycast-gateway disable {vid}' executing...") | ||
|
|
||
| if not clicommon.is_vlanid_in_range(vid): |
There was a problem hiding this comment.
if this check is needed, maybe we should do the same for enable_vlan_sag; otherwise, please remove this check
config/vlan.py
Outdated
| keys = [ (k, v) for k, v in db.cfgdb.get_table('VLAN_MEMBER') if k == 'Vlan{}'.format(vid) ] | ||
|
|
||
| if keys: | ||
| ctx.fail("VLAN ID {} can not be removed. First remove all members assigned to this VLAN.".format(vid)) |
config/vlan.py
Outdated
| if keys: | ||
| ctx.fail("VLAN ID {} can not be removed. First remove all members assigned to this VLAN.".format(vid)) | ||
|
|
||
| db.cfgdb.set_entry('VLAN', 'Vlan{}'.format(vid), None) |
show/main.py
Outdated
| @clicommon.pass_db | ||
| def sag(db): | ||
| """Show static anycast gateway information""" | ||
| sag_entry = db.cfgdb.get_entry('SAG', 'GLOBAL') |
There was a problem hiding this comment.
what if SAG is not configured?
show/main.py
Outdated
| body = [] | ||
| intf_dict = db.cfgdb.get_table('VLAN_INTERFACE') | ||
| if intf_dict: | ||
| for intf in intf_dict: |
There was a problem hiding this comment.
It would be more brief to use
for key,value in intf_dict.items():
if value.get('static_anycast_gateway') == 'true':
show/vlan.py
Outdated
| cfg, _ = ctx | ||
| _, vlan_ip_data, _ = cfg | ||
|
|
||
| for key in vlan_ip_data: |
There was a problem hiding this comment.
why do we need a for loop here? how about this:
if vlan in vlan_ip_data:28a1396 to
3ba8241
Compare
|
@zhangyanzhao |
What I did
Refer to SAG HLD#837
How I did it
How to verify it
Signed-off-by: Jimi Chen jimi_chen@edge-core.com