From 4a4813267afbcf8e20e7b6c46ec44e493c3e625c Mon Sep 17 00:00:00 2001 From: Andy Southgate Date: Tue, 27 Nov 2007 19:23:34 +0000 Subject: [PATCH] Use OEM configuration file if present --- XSConsoleConfig.py | 19 +++++++++++++++++++ XSConsoleDialogues.py | 4 ++-- xsconsole.e4p | 5 ++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/XSConsoleConfig.py b/XSConsoleConfig.py index b5299ad..81b3e27 100644 --- a/XSConsoleConfig.py +++ b/XSConsoleConfig.py @@ -1,4 +1,6 @@ +import os + class Config: instance = None @@ -21,6 +23,9 @@ def __init__(self): 'recovery_bg_bright' : (0, 200, 266) } + + self.ftpname = 'XenServer Support' + self.ftpserver = 'ftp://support.xensource.com/' @classmethod def Inst(cls): @@ -28,6 +33,20 @@ def Inst(cls): cls.instance = Config() return cls.instance + @classmethod + def Mutate(cls, inConfig): + cls.instance = inConfig + def Colour(self, inName): return self.colours[inName] + def FTPName(self): + return self.ftpname + + def FTPServer(self): + return self.ftpserver + +# Import a more specific configuration if available +if os.path.isfile('XSConsoleConfigOEM.py'): + import XSConsoleConfigOEM + diff --git a/XSConsoleDialogues.py b/XSConsoleDialogues.py index 5e66bec..a94ad0a 100755 --- a/XSConsoleDialogues.py +++ b/XSConsoleDialogues.py @@ -1063,7 +1063,7 @@ def DoCommit(self): filename = self.vdiMount.MountedPath(self.filename) FileUtils.AssertSafePath(filename) - command = "/opt/xensource/bin/xe host-backup file-name='"+filename+"'" + command = "/opt/xensource/bin/xe host-backup file-name='"+filename+"' host="+hostRef status, output = commands.getstatusoutput(command) if status != 0: @@ -1115,7 +1115,7 @@ def DoAction(self): filename = self.vdiMount.MountedPath(self.filename) FileUtils.AssertSafePath(filename) - command = "/opt/xensource/bin/xe host-restore file-name='"+filename+"'" + command = "/opt/xensource/bin/xe host-restore file-name='"+filename+"' host="+hostRef status, output = commands.getstatusoutput(command) if status != 0: diff --git a/xsconsole.e4p b/xsconsole.e4p index 1f01b08..0fe1de1 100644 --- a/xsconsole.e4p +++ b/xsconsole.e4p @@ -1,7 +1,7 @@ - + Python @@ -56,6 +56,9 @@ XSConsoleUtils.py + + XSConsoleConfigOEM.py +