Skip to content

Commit

Permalink
[LEDs]: Initialize status and fan LEDs to green on Arista 7050-QX-32/…
Browse files Browse the repository at this point in the history
…7050-QX-32-S (#886)
  • Loading branch information
jleveque authored Aug 14, 2017
1 parent 178fc03 commit 49feeaa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
20 changes: 20 additions & 0 deletions device/arista/x86_64-arista_7050_qx32/plugins/led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@ def port_link_state_change(self, port, state):

# Constructor
def __init__(self):
# Initialize all front-panel status LEDs to green
with open("/sys/class/leds/status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/fan_status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu1/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu2/brightness", "w") as f:
f.write("1")

# Initialize all fan LEDs to green
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan1_led", "w") as f:
f.write("3")
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan2_led", "w") as f:
f.write("3")
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan3_led", "w") as f:
f.write("3")
with open("/sys/devices/platform/sb800-fans/hwmon/hwmon1/fan4_led", "w") as f:
f.write("3")

# Initialize: Turn all front panel QSFP LEDs off
for qsfp_index in range(self.QSFP_BREAKOUT_START_IDX, self.QSFP_BREAKOUT_END_IDX + 1):
for lane in range(1, 5):
Expand Down
21 changes: 21 additions & 0 deletions device/arista/x86_64-arista_7050_qx32s/plugins/led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ def port_link_state_change(self, port, state):

# Constructor
def __init__(self):
# Initialize all front-panel status LEDs to green
with open("/sys/class/leds/status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/fan_status/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu1/brightness", "w") as f:
f.write("1")
with open("/sys/class/leds/psu2/brightness", "w") as f:
f.write("1")

# Initialize all fan LEDs to green
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan1_led", "w") as f:
f.write("1")
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan2_led", "w") as f:
f.write("1")
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan3_led", "w") as f:
f.write("1")
with open("/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/i2c-3/3-0060/hwmon/hwmon2/fan4_led", "w") as f:
f.write("1")


# Initialize: Turn all front panel QSFP LEDs off
for qsfp_index in range(self.QSFP_BREAKOUT_START_IDX, self.QSFP_BREAKOUT_END_IDX + 1):
for lane in range(1, 5):
Expand Down

0 comments on commit 49feeaa

Please sign in to comment.