View | Details | Raw Unified | Return to bug 22190 | Differences between
and this patch

Collapse All | Expand All

(-)debian/univention-client-boot-pxe.univention-baseconfig (-1 / +8 lines)
 Lines 8-16    Link Here 
8
Variables: pxe/loglevel
8
Variables: pxe/loglevel
9
Variables: pxe/append
9
Variables: pxe/append
10
Variables: pxe/nfsroot
10
Variables: pxe/nfsroot
11
Variables: pxe/thinclient/flash/server
11
12
12
Type: module
13
Type: module
13
Module: clientbootpxe.py
14
Module: clientbootpxe.py
15
Variables: pxe/vga
16
Variables: pxe/quiet
14
Variables: pxe/nameserver
17
Variables: pxe/nameserver
15
Variables: pxe/quiet
18
Variables: pxe/ldapserver
19
Variables: pxe/ldapport
16
Variables: pxe/loglevel
20
Variables: pxe/loglevel
21
Variables: pxe/append
22
Variables: pxe/nfsroot
23
Variables: pxe/thinclient/flash/server
(-)debian/postinst (-1 / +1 lines)
 Lines 3-9    Link Here 
3
# Univention Client Boot PXE
3
# Univention Client Boot PXE
4
#  postinst script
4
#  postinst script
5
#
5
#
6
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Univention GmbH
6
# Copyright (C) 2001-2011 Univention GmbH
7
#
7
#
8
# http://www.univention.de/
8
# http://www.univention.de/
9
#
9
#
(-)debian/prerm (-1 / +1 lines)
 Lines 3-9    Link Here 
3
# Univention Client Boot PXE
3
# Univention Client Boot PXE
4
#  prerm script
4
#  prerm script
5
#
5
#
6
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Univention GmbH
6
# Copyright (C) 2001-2011 Univention GmbH
7
#
7
#
8
# http://www.univention.de/
8
# http://www.univention.de/
9
#
9
#
(-)debian/changelog (+19 lines)
 Lines 1-3    Link Here 
1
univention-client-boot-pxe (6.1.2-1) unstable; urgency=low
2
3
  * merged changes from customer scope Ticket: #2011041210005499 
4
5
 -- Felix Botner <botner@univention.de>  Mon, 15 Aug 2011 16:19:27 +0200
6
7
univention-client-boot-pxe (6.1.1-1) unstable; urgency=low
8
9
  * fixed templates/modules/clientbootpxe.py Ticket #2011030710000906 
10
11
 -- Felix Botner <botner@univention.de>  Mon, 11 Apr 2011 10:21:38 +0200
12
13
univention-client-boot-pxe (6.1.0-1) unstable; urgency=low
14
15
  * added pxe/thinclient/flash/server
16
  * update tc configs for all pxe vars Ticket #2011030710000906 
17
18
 -- Felix Botner <botner@univention.de>  Mon, 11 Apr 2011 08:54:42 +0200
19
1
univention-client-boot-pxe (4.0.0-1) unstable; urgency=low
20
univention-client-boot-pxe (4.0.0-1) unstable; urgency=low
2
21
3
  * Bump version for UCS TCS 3.1 (Bug #20041)
22
  * Bump version for UCS TCS 3.1 (Bug #20041)
(-)debian/copyright (-1 / +1 lines)
 Lines 1-4    Link Here 
1
Copyright 2001,2002,2003,2004,2005,2006,2007 by
1
Copyright 2001-2011 by
2
2
3
Univention GmbH
3
Univention GmbH
4
http://www.univention.de/
4
http://www.univention.de/
(-)debian/rules (-1 / +1 lines)
 Lines 3-9    Link Here 
3
# Univention Client Boot PXE
3
# Univention Client Boot PXE
4
#  rules file for the debian package
4
#  rules file for the debian package
5
#
5
#
6
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Univention GmbH
6
# Copyright (C) 2001-2011 Univention GmbH
7
#
7
#
8
# http://www.univention.de/
8
# http://www.univention.de/
9
#
9
#
(-)clientbootpxe.py (-1 / +1 lines)
 Lines 4-10    Link Here 
4
# Univention Client Boot PXE
4
# Univention Client Boot PXE
5
#  Univention Listener Module
5
#  Univention Listener Module
6
#
6
#
7
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Univention GmbH
7
# Copyright (C) 2001-2011 Univention GmbH
8
#
8
#
9
# http://www.univention.de/
9
# http://www.univention.de/
10
#
10
#
(-)conffiles/clientbootpxe.py (-41 / +103 lines)
 Lines 1-9    Link Here 
1
# -*- coding: utf-8 -*-
1
# -*- coding: utf-8 -*-
2
#
2
#
3
# Univention Client Boot PXE
3
# Univention Client Boot PXE
4
#  baseconfig/listener module: update nameserver for PXE clients
4
#  baseconfig/listener module: update config for PXE clients
5
#
5
#
6
# Copyright (C) 2004, 2005, 2006, 2007 Univention GmbH
6
# Copyright (C) 2004-2011 Univention GmbH
7
#
7
#
8
# http://www.univention.de/
8
# http://www.univention.de/
9
#
9
#
 Lines 33-85    Link Here 
33
from fileinput import *
33
from fileinput import *
34
from glob import glob
34
from glob import glob
35
35
36
var = 'pxe/nameserver'
37
pattern = '/var/lib/univention-client-boot/pxelinux.cfg/*'
36
pattern = '/var/lib/univention-client-boot/pxelinux.cfg/*'
38
37
39
def update_nameserver(line, nameserver):
38
def update_nameserver (line, changes):
40
	line = line.strip('\n')
39
	if type(changes.get('pxe/nameserver')) == type(()):
41
	if 'DNSSERVER=' in line:
40
		old, new = changes.get('pxe/nameserver', (False, False))
42
		sp = line.split(' ')
41
		if not old == new:
43
		line = ''
42
			line = re.sub("(^| )DNSSERVER=[^ ]+($| )", " ", line)
44
		for element in sp:
43
			if new:
45
			if element.startswith('DNSSERVER='):
44
				line = line.rstrip()
46
				element = 'DNSSERVER=%s' % nameserver
45
				line = line + " DNSSERVER=%s" % new
47
			if line == '':
46
			
48
				line = element
47
	return line
49
			else:
50
				line = '%s %s' % (line, element)
51
		return line
52
	else:
53
		return line
54
48
55
def update_loglevel(line, loglevel):
49
def update_loglevel (line, changes):
56
	line = line.strip('\n')
50
	if type(changes.get('pxe/loglevel')) == type(()):
57
	if 'APPEND root=' in line:
51
		old, new = changes.get('pxe/loglevel', (False, False))
58
		line = re.sub(" loglevel=\d+", "", line)
52
		if not old == new:
59
		if loglevel:
53
			line = re.sub("(^| )loglevel=[^ ]+($| )", " ", line)
60
			line = line + " loglevel=%s" % loglevel
54
			if new:
55
				line = line.rstrip()
56
				line = line + " loglevel=%s" % new
61
	return line
57
	return line
62
58
63
def update_quiet(line, quiet):
59
def update_quiet (line, changes):
64
	line = line.strip('\n')
60
	if type(changes.get('pxe/quit')) == type(()):
65
	if 'APPEND root=' in line:
61
		old, new = changes.get('pxe/quiet', (False, False))
66
		if ' quiet' in line:
62
		if not old == new:
67
			if not quiet:
63
			line = re.sub("(^| )quiet($| )", " ", line)
68
				line = line.replace(" quiet", "")
64
			if new and new.lower() in ['yes', 'true', '1']:
69
		if not ' quiet' in line:
65
				line = line.rstrip()
70
			if quiet:
71
				line = line + " quiet"
66
				line = line + " quiet"
72
	return line
67
	return line
73
68
69
def update_vga (line, changes):
70
	if type(changes.get('pxe/vga')) == type(()):
71
		old, new = changes.get('pxe/vga', (False, False))
72
		if not old == new:
73
			line = re.sub("(^| )vga=[^ ]+($| )", " ", line)
74
			if new:
75
				line = line.rstrip()
76
				line = line + " vga=%s" % new
77
	return line
78
79
def update_ldap_port (line, changes):
80
	if type(changes.get('pxe/ldapport')) == type(()):
81
		old, new = changes.get('pxe/ldapport', (False, False))
82
		if not old == new:
83
			line = re.sub("(^| )ldapPort=[^ ]+($| )", " ", line)
84
			if new:
85
				line = line.rstrip()
86
				line = line + " ldapPort=%s" % new
87
	return line
88
89
def update_flash_server (line, changes):
90
	if type(changes.get('pxe/thinclient/flash/server')) == type(()):
91
		old, new = changes.get('pxe/thinclient/flash/server', (False, False))
92
		if not old == new:
93
			line = re.sub("(^| )flashServer=[^ ]+($| )", " ", line)
94
			if new:
95
				line = line.rstrip()
96
				line = line + " flashServer=%s" % new
97
	return line
98
99
def update_nfs_root (line, changes):
100
	if type(changes.get('pxe/nfsroot')) == type(()):
101
		old, new = changes.get('pxe/nfsroot', (False, False))
102
		if not old == new:
103
			line = re.sub("(^| )nfsroot=[^:]+:/var/lib/univention-client-root($| )", " ", line)
104
			if new:
105
				line = line.rstrip()
106
				line = line + " nfsroot=%s:/var/lib/univention-client-root" % new
107
	return line
108
109
def update_ldapserver (line, changes):
110
	if type(changes.get('pxe/ldapserver')) == type(()):
111
		old, new = changes.get('pxe/ldapserver', (False, False))
112
		if not old == new:
113
			# old syntax ldapServer=10.200.1.1
114
			line = re.sub('(^| )ldapServer=[^" ]+($| )', " ", line)
115
			# new syntax ldapServer="10.200.1.1"
116
			line = re.sub('(^| )ldapServer="[^"]+"($| )', " ", line)
117
			if new:
118
				line = line.rstrip()
119
				line = line + ' ldapServer="%s"' % new
120
	return line
121
122
def update_append(line, changes):
123
	if type(changes.get('pxe/append')) == type(()):
124
		old, new = changes.get('pxe/append', ("", ""))
125
		if not old == new:
126
			line = re.sub('(^| )%s($| )' % old, " ", line)
127
			if new:
128
				line = line.rstrip()
129
				line = line + ' %s' % new
130
	return line
131
132
74
def handler(baseConfig, changes):
133
def handler(baseConfig, changes):
75
	nameserver = baseConfig.get(var)
134
76
	quiet = False
77
	if baseConfig.get('pxe/quiet', "False").lower() in ['yes', 'true', '1']:
78
		quiet = True
79
	loglevel = baseConfig.get('pxe/loglevel', False)
80
	for line in input(glob(pattern), inplace = True):
135
	for line in input(glob(pattern), inplace = True):
81
		if nameserver:
136
		line = line.strip('\n')
82
			line = update_nameserver(line, nameserver)
137
		if 'APPEND root=' in line:
83
		line = update_quiet(line, quiet)
138
			line = update_nameserver(line, changes)
84
		line = update_loglevel(line, loglevel)
139
			line = update_loglevel(line, changes)
140
			line = update_quiet(line, changes)
141
			line = update_vga(line, changes)
142
			line = update_ldap_port(line, changes)
143
			line = update_flash_server(line, changes)
144
			line = update_nfs_root(line, changes)
145
			line = update_ldapserver(line, changes)
146
			line = update_append(line, changes)
85
		print line
147
		print line
(-)conffiles/etc/univention/client-boot-pxe/pxeconfig (-1 / +3 lines)
 Lines 24-32    Link Here 
24
if baseConfig.get('pxe/quiet', "False").lower() in ['yes', 'true', '1']:
24
if baseConfig.get('pxe/quiet', "False").lower() in ['yes', 'true', '1']:
25
	line += 'quiet '
25
	line += 'quiet '
26
if 'pxe/ldapserver' in baseConfig.keys():
26
if 'pxe/ldapserver' in baseConfig.keys():
27
	line += 'ldapServer=%s ' % baseConfig['pxe/ldapserver']
27
	line += 'ldapServer="%s" ' % baseConfig['pxe/ldapserver']
28
if 'pxe/ldapport' in baseConfig.keys():
28
if 'pxe/ldapport' in baseConfig.keys():
29
	line += 'ldapPort=%s ' % baseConfig['pxe/ldapport']
29
	line += 'ldapPort=%s ' % baseConfig['pxe/ldapport']
30
if 'pxe/thinclient/flash/server' in baseConfig.keys():
31
	line += 'flashServer=%s ' % baseConfig['pxe/thinclient/flash/server']
30
if 'pxe/append' in baseConfig.keys():
32
if 'pxe/append' in baseConfig.keys():
31
	line += '%s ' % baseConfig['pxe/append']
33
	line += '%s ' % baseConfig['pxe/append']
32
if baseConfig.get('pxe/loglevel', False):
34
if baseConfig.get('pxe/loglevel', False):
(-)91univention-client-boot-pxe.inst (-1 / +1 lines)
 Lines 3-9    Link Here 
3
# Univention Client Boot PXE
3
# Univention Client Boot PXE
4
#  join script for the client boot PXE debian package
4
#  join script for the client boot PXE debian package
5
#
5
#
6
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Univention GmbH
6
# Copyright (C) 2001-2011 Univention GmbH
7
#
7
#
8
# http://www.univention.de/
8
# http://www.univention.de/
9
#
9
#

Return to bug 22190