diff --git a/XSConsoleConfig.py b/XSConsoleConfig.py index 95fcef3..b934d80 100644 --- a/XSConsoleConfig.py +++ b/XSConsoleConfig.py @@ -30,6 +30,12 @@ def __init__(self): } self.ftpserver = '' + + self.xcpconfigdir = '' + for path in ["/etc/xcp", "/etc/xensource"]: + if os.path.exists(path): + self.xcpconfigdir = path + break @classmethod def Inst(cls): @@ -65,6 +71,9 @@ def BMCName(self): def FirstBootEULAs(self): # Subclasses in XSConsoleConfigOEM can add their EULAs to this array return ['/EULA'] + + def XCPConfigDir(self): + return self.xcpconfigdir # Import a more specific configuration if available if os.path.isfile(sys.path[0]+'/XSConsoleConfigOEM.py'): diff --git a/XSConsoleData.py b/XSConsoleData.py index 28394af..2bcf9e4 100644 --- a/XSConsoleData.py +++ b/XSConsoleData.py @@ -123,7 +123,7 @@ def Create(self): if status == 0: self.ScanCPUInfo(output.split("\n")) - (status, output) = commands.getstatusoutput("/usr/bin/openssl x509 -in /etc/xensource/xapi-ssl.pem -fingerprint -noout") + (status, output) = commands.getstatusoutput("/usr/bin/openssl x509 -in %s/xapi-ssl.pem -fingerprint -noout" % (Config.Inst().XCPConfigDir())) if status == 0: fp = output.split("=") if len(fp) >= 2: diff --git a/plugins-base/XSFeatureNetworkReset.py b/plugins-base/XSFeatureNetworkReset.py index 87db98c..32fc2c8 100644 --- a/plugins-base/XSFeatureNetworkReset.py +++ b/plugins-base/XSFeatureNetworkReset.py @@ -18,7 +18,7 @@ from XSConsoleStandard import * -pool_conf = '/etc/xensource/pool.conf' +pool_conf = '%s/pool.conf' % (Config.Inst().XCPConfigDir()) interface_reconfigure = '/opt/xensource/libexec/interface-reconfigure' inventory_file = '/etc/xensource-inventory' management_conf = '/etc/firstboot.d/data/management.conf'