Skip to content

Commit 6e878a3

Browse files
authored
[mux] Exit to write standby state to active-active ports (#11821)
[mux] Exit to write standby state to `active-active` ports Signed-off-by: Longxiang Lyu <[email protected]>
1 parent 46292d7 commit 6e878a3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

files/build_templates/mux.service.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ExecStartPre=/usr/local/bin/mark_dhcp_packet.py
1414
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
1515
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
1616
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
17-
ExecStopPost=/usr/local/bin/write_standby.py
17+
ExecStopPost=/usr/local/bin/write_standby.py --shutdown mux
1818
Restart=always
1919
RestartSec=30
2020

files/scripts/write_standby.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ def apply_mux_config(self):
178178
parser.add_argument('-s', '--active_standby',
179179
help='state: intial state for "auto" and/or "manual" config in active-standby mode, default "standby"',
180180
type=str, required=False, default='standby')
181+
parser.add_argument('--shutdown', help='write mux state after shutdown other services, supported: mux',
182+
type=str, required=False, choices=['mux'])
181183
args = parser.parse_args()
182-
mux_writer = MuxStateWriter(activeactive=args.active_active, activestandby=args.active_standby)
184+
active_active_state = args.active_active
185+
active_standby_state = args.active_standby
186+
if args.shutdown == 'mux':
187+
active_active_state = "standby"
188+
mux_writer = MuxStateWriter(activeactive=active_active_state, activestandby=active_standby_state)
183189
mux_writer.apply_mux_config()

0 commit comments

Comments
 (0)