Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Search for xapi config in /etc/xcp as well as /etc/xensource
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbulpin authored and andyhhp committed Jan 24, 2014
1 parent 8f2c1ce commit 3990228
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions XSConsoleConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'):
Expand Down
2 changes: 1 addition & 1 deletion XSConsoleData.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion plugins-base/XSFeatureNetworkReset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 3990228

Please sign in to comment.