Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mux] Exit to write standby state to active-active ports #11821

Merged
merged 3 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/build_templates/mux.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ExecStartPre=/usr/local/bin/mark_dhcp_packet.py
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
ExecStopPost=/usr/local/bin/write_standby.py
ExecStopPost=/usr/local/bin/write_standby.py --shutdown mux
Restart=always
RestartSec=30

Expand Down
8 changes: 7 additions & 1 deletion files/scripts/write_standby.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ def apply_mux_config(self):
parser.add_argument('-s', '--active_standby',
help='state: intial state for "auto" and/or "manual" config in active-standby mode, default "standby"',
type=str, required=False, default='standby')
parser.add_argument('--shutdown', help='write mux state after shutdown other services, supported: mux',
type=str, required=False, choices=['mux'])
args = parser.parse_args()
mux_writer = MuxStateWriter(activeactive=args.active_active, activestandby=args.active_standby)
active_active_state = args.active_active
active_standby_state = args.active_standby
if args.shutdown == 'mux':
active_active_state = "standby"
mux_writer = MuxStateWriter(activeactive=active_active_state, activestandby=active_standby_state)
mux_writer.apply_mux_config()