summaryrefslogtreecommitdiffstats
path: root/kickstart.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-08-18 20:39:10 +0000
committerMike Fulbright <msf@redhat.com>2003-08-18 20:39:10 +0000
commit5629d8f5f87f3a0ef9aa9807d6d771a0cd98412a (patch)
tree5b13b979d9c28481718d4d92e91fa14c3f5ac42f /kickstart.py
parenteec5eb96eabe1d23e9af2fe651b0ed65255b8d79 (diff)
downloadanaconda-5629d8f5f87f3a0ef9aa9807d6d771a0cd98412a.tar.gz
anaconda-5629d8f5f87f3a0ef9aa9807d6d771a0cd98412a.tar.xz
anaconda-5629d8f5f87f3a0ef9aa9807d6d771a0cd98412a.zip
add feature from bug #101903 - vnc specification in ks file
Diffstat (limited to 'kickstart.py')
-rw-r--r--kickstart.py54
1 files changed, 53 insertions, 1 deletions
diff --git a/kickstart.py b/kickstart.py
index cc8acbc7b..22c9e6de1 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -573,6 +573,7 @@ class KickstartBase(BaseInstallClass):
"interactive" : self.doInteractive ,
"autostep" : self.doAutoStep ,
"firstboot" : self.doFirstboot ,
+ "vnc" : None ,
}
packages = []
@@ -580,7 +581,7 @@ class KickstartBase(BaseInstallClass):
excludedPackages = []
for n in open(file).readlines():
args = isys.parseArgv(n)
-
+
# don't eliminate white space or comments from scripts
if where not in ["pre", "post", "traceback"]:
if not args or args[0][0] == '#': continue
@@ -1355,6 +1356,57 @@ def Kickstart(file, serial):
return ksClass
+# see if any vnc parameters are specified in the kickstart file
+def parseKickstartVNC(ksfile):
+ try:
+ f = open(ksfile, "r")
+ except:
+ raise KSAppendException("Unable to open ks file %s" % (ksfile,))
+
+ lines = f.readlines()
+ f.close()
+
+ usevnc = 0
+ vnchost = None
+ vncport = None
+ vncpasswd = None
+ for l in lines:
+ args = isys.parseArgv(l)
+
+ if args:
+ if args[0] != 'vnc':
+ continue
+ else:
+ continue
+
+ idx = 1
+ while idx < len(args):
+ if args[idx] == "--password":
+ try:
+ vncpasswd = args[idx+1]
+ except:
+ raise RuntimeError, "Missing argument to vnc --password option"
+ idx += 2
+ elif args[idx] == "--connecthost":
+ try:
+ vnchost = args[idx+1]
+ except:
+ raise RuntimeError, "Missing argument to vnc --connecthost option"
+ idx += 2
+ elif args[idx] == "--connectport":
+ try:
+ vncport = args[idx+1]
+ except:
+ raise RuntimeError, "Missing argument to vnc --connectport option"
+ idx += 2
+ else:
+ raise RuntimeError, "Unknown vnc option %s" % (arg[idx],)
+
+ usevnc = 1
+ break
+
+ return (usevnc, vncpasswd, vnchost, vncport)
+
#
# look through ksfile and if it contains a line:
#