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

Commit

Permalink
Use OEM configuration file if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Southgate committed Nov 27, 2007
1 parent 74cbf33 commit 4a48132
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
19 changes: 19 additions & 0 deletions XSConsoleConfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

import os

class Config:
instance = None

Expand All @@ -21,13 +23,30 @@ def __init__(self):
'recovery_bg_bright' : (0, 200, 266)

}

self.ftpname = 'XenServer Support'
self.ftpserver = 'ftp://support.xensource.com/'

@classmethod
def Inst(cls):
if cls.instance is None:
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

4 changes: 2 additions & 2 deletions XSConsoleDialogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion xsconsole.e4p
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-4.0.dtd">
<!-- eric4 project file for project xsconsole -->
<!-- Saved: 2007-11-23, 18:56:35 -->
<!-- Saved: 2007-11-27, 19:14:37 -->
<!-- Copyright (C) 2007 , -->
<Project version="4.0">
<ProgLanguage mixed="0">Python</ProgLanguage>
Expand Down Expand Up @@ -56,6 +56,9 @@
<Source>
<Name>XSConsoleUtils.py</Name>
</Source>
<Source>
<Name>XSConsoleConfigOEM.py</Name>
</Source>
</Sources>
<Forms>
</Forms>
Expand Down

0 comments on commit 4a48132

Please sign in to comment.