Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelmsft committed Feb 10, 2022
2 parents 729e4f7 + 377a9e5 commit 0277347
Show file tree
Hide file tree
Showing 105 changed files with 4,640 additions and 1,546 deletions.
2 changes: 2 additions & 0 deletions ansible/devutil/inv_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def get_host_list(self, category, limit=None):
@param limit: The host patterns (None and empty string mean no limit)
@return: A dict {hostname:vars}
"""
if limit and limit.lower() == 'all':
limit = '*'
if not limit or limit == '':
limit = '*'
res = {}
Expand Down
7 changes: 7 additions & 0 deletions ansible/devutils
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ def main():
if not validate_args(args):
return
build_global_vars(args.concurrency, args.inventory)
# Add limit argument check for pdu_reboot, pdu_on, pdu_off actions
# If no limit argument for these actions, will not execute the process for all devices
if args.action in ['pdu_reboot', 'pdu_on', 'pdu_off']:
if not args.limit or args.limit == '':
print("devutils: error: argument -l/--limit is required for pdu_reboot, pdu_on, pdu_off actions to avoid impacting all devices accidentally.")
print("If you are sure to do pdu action to all devices, please use -l/--limit all.")
return
hosts = retrieve_hosts(args.group, args.limit)
get_conn_graph_facts(hosts)
actions = {'list': action_list,
Expand Down
16 changes: 3 additions & 13 deletions ansible/dualtor/config_simulated_y_cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,14 @@
vm_set_name: "{{ testbed_facts['group-name'] }}"
dut_side: "{% if dut_index|int == 0 %}upper_tor{% else %}lower_tor{% endif %}"

# Legacy - inject simulated y cable driver
- block:
- name: Generate y_cable_simulator driver to DUTs
template: src=dualtor/y_cable_simulator_client.j2
dest=/tmp/y_cable_simulator_client.py
become: true

- name: Copy y_cable_simulator to pmon container in DUTs
shell: docker cp /tmp/y_cable_simulator_client.py pmon:/usr/lib/python3/dist-packages

# New - inject mux simulator config
# Inject mux simulator config
# Below step is required after these PRs are merged:
# * https://github.com/Azure/sonic-platform-common/pull/213
# * https://github.com/Azure/sonic-platform-daemons/pull/197
# For the simulated y_cable driver to work, basic configuration information of the mux simulator is required.
# When /etc/sonic/mux_simulator.json file is found on DUT, xcvrd will try to load simulated y_cable driver.
# File /etc/sonic/mux_simulator.json can co-exist with the 'y_cable_simulator_client.py' file injected above.
# Process xcvrd will determine which one to load or use.
# Otherwise, xcvrd will try to get cable vendor and model, then load corresponding y_cable driver based on
# actual vendor/model of connected cable.
- name: Generate mux simulator configuration for DUTs
template: src=dualtor/mux_simulator.json.j2
dest=/etc/sonic/mux_simulator.json
Expand Down
Loading

0 comments on commit 0277347

Please sign in to comment.