Move closeMuxes script to a regex
This is to allow muxes of any type to be closed correctly on restart.
Change-Id: Ib0e15d3ca6309e7a297c910bded2ce172d16f956
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/scripts/CloseMuxes.py b/scripts/CloseMuxes.py
index abbe84b..a1d29b3 100644
--- a/scripts/CloseMuxes.py
+++ b/scripts/CloseMuxes.py
@@ -11,10 +11,9 @@
import os
import json
import subprocess
-
+import re
CONFIGURATION_FILE = '/var/configuration/system.json'
-MUX_TYPES = ['PCA9543Mux', 'PCA9545Mux']
if not os.path.isfile(CONFIGURATION_FILE):
print('No Configuration')
@@ -24,7 +23,7 @@
for _, entity in configuration.iteritems():
for exposed in entity.get('Exposes', []):
- if exposed.get('Type', None) in MUX_TYPES:
+ if re.match("PCA954\\dMux", exposed.get('Type', None)):
bus = exposed.get('Bus', False)
address = exposed.get('Address', False)
if bus and address: