Ejemplo n.º 1
0
 def start(self):
     self.debug('==> start')
     #search cdrom
     self.sub = self.active(self, _('Searching CD-ROM Drive'),
                            _('Please wait ...'))
     self.sub.action = 'cdrom-search'
     self.sub.draw()
Ejemplo n.º 2
0
    def layout(self):
        ## clear layout
        self.reset_layout()
        # add default buttons
        self.std_button()

        self.find_devices()

        msg = _(
            'This module is used to specifiy the device where to install the boot loader. The correct device depends on current BIOS settings and partitioning. If an incorrect device has been selected, the installed system may not boot. If unsure, continue without change.'
        )
        self.add_elem(
            'TA_desc',
            textarea(msg, self.minY - 10, self.minX + 5, 8,
                     self.maxWidth + 11))

        pos = self.minY - 10 + self.get_elem('TA_desc').get_number_of_lines()

        self.add_elem(
            'TL_headline',
            textline(_('Select where to install the GRUB boot loader:'),
                     pos + 1, self.minX + 5))
        self.add_elem(
            'DEVICE',
            select(self.devices, pos + 3, self.minX + 5, self.max_length, 15,
                   self.devices.get(self.selected_device, [0, 0])[1]))
        self.move_focus(self.get_elem_id('DEVICE'))
Ejemplo n.º 3
0
    def searchusb(self):
        self.sub = self.active(self, _('Loading Modules'), '', 'loadmodule',
                               ['usb-storage'])
        self.sub.draw()
        self.sub = self.active(self, _('Initialize USB Devices'), '', 'sleep',
                               10)
        self.sub.draw()
        usbdev = []
        uname = os.popen('/bin/uname -r')
        self.container['kernelversion'] = uname.readline().strip()

        if os.path.exists('/lib/univention-installer/usb-device.sh'):
            if self.container['kernelversion'].startswith('2.4.'):
                devices = os.popen(
                    '/lib/univention-installer/usb-device.sh 2.4')
            else:
                devices = os.popen(
                    '/lib/univention-installer/usb-device.sh 2.6')
            for device in devices.readlines():
                usbdev.append('/dev/%s' % device.split(' ')[3].strip())
                usbdev.append('/dev/%s1' % device.split(' ')[3].strip())
        elif os.path.exists('usb-device.sh'):
            if self.container['kernelversion'].startswith('2.4.'):
                devices = os.popen('./usb-device.sh 2.4')
            else:
                devices = os.popen('./usb-device.sh 2.6')
            for device in devices.readlines():
                usbdev.append('/dev/%s' % device.split(' ')[3].strip())
                usbdev.append('/dev/%s1' % device.split(' ')[3].strip())
        return usbdev
Ejemplo n.º 4
0
	def layout(self):
		self.packages=[]
		self.categories=[]
		self.reset_layout()

		self._init_categories()
		self._init_packages()

		pos = 0
		for k in self.category_order:
			p = self.getPackages(k)
			self.add_elem('packages_%s' % k, checkbox(p, self.minY-9+pos,self.minX+6, 65, 14, self.getSelected(k))) #5
			pos += (len(p) + 1)

		if self.cmdline.has_key('mode') and self.cmdline['mode'] == 'setup':
			self.add_elem('__NEXT_BUTTON__', button(_("F12-Accept changes"),self.pos_y+self.height-2,self.pos_x+self.width-2, align='right')) #6
			self.debug('moaded_modules=%s' % self.cmdline['loaded_modules'])
			if self.cmdline.has_key('loaded_modules') and len(self.cmdline['loaded_modules']) >1:
				self.add_elem('__BACK_BUTTON__', button(_("F11-Back"),self.pos_y+self.height-2,self.pos_x+4, align='left')) #7
			else:
				self.add_elem('__BACK_BUTTON__', textline("",self.pos_y+self.height-2,self.pos_x+4,align='left')) #7
		else:
			self.add_elem('__NEXT_BUTTON__', button(_("F12-Next"),self.pos_y+self.height-2,self.pos_x+self.width-2, align='right')) #6
			self.add_elem('__BACK_BUTTON__', button(_("F11-Back"),self.pos_y+self.height-2,self.pos_x+4, align='left')) #7

		self.add_elem('headline', textline(_('Please select the software components you want to install:'), self.minY-11,self.minX+3))

		self.current=0
		self.elements[0].set_on()

		# skip the initial "tab" "tab"
		self.skip_tab = True
Ejemplo n.º 5
0
	def searchusb(self):
		self.sub=self.active(self,_('Loading Modules'),'','loadmodule',['usb-storage'])
		self.sub.draw()
		self.sub=self.active(self,_('Initialize USB Devices'),'','sleep',10)
		self.sub.draw()
		usbdev=[]
		uname=os.popen('/bin/uname -r')
		self.container['kernelversion']=uname.readline().strip()

		if os.path.exists('/lib/univention-installer/usb-device.sh'):
			if self.container['kernelversion'].startswith('2.4.'):
				devices=os.popen('/lib/univention-installer/usb-device.sh 2.4')
			else:
				devices=os.popen('/lib/univention-installer/usb-device.sh 2.6')
			for device in devices.readlines():
				usbdev.append('/dev/%s' % device.split(' ')[3].strip())
				usbdev.append('/dev/%s1' % device.split(' ')[3].strip())
		elif os.path.exists('usb-device.sh'):
			if self.container['kernelversion'].startswith('2.4.'):
				devices=os.popen('./usb-device.sh 2.4')
			else:
				devices=os.popen('./usb-device.sh 2.6')
			for device in devices.readlines():
				usbdev.append('/dev/%s' % device.split(' ')[3].strip())
				usbdev.append('/dev/%s1' % device.split(' ')[3].strip())
		return usbdev
Ejemplo n.º 6
0
    def layout(self):
        dict = {}
        self.elements.append(
            textline(_('A Python Exception has occured!'), self.pos_y + 2,
                     self.pos_x + 2))  #0

        debug(str(self.comment))
        i = 0
        for line in self.comment:
            obj = textline(line, self.pos_y + 3 + i, self.pos_x + 2)
            i += 1
            self.elements.append(obj)

        count = i
        f = open('/tmp/installation.error', 'a+')
        for l in self.message:
            l = l.replace('\n', '')
            l = l.replace('\r', '')
            l = l.strip(' ')
            self.elements.append(
                textline(l[:self.message_width], self.pos_y + 4 + count,
                         self.pos_x + 2))  #2...
            count = count + 1
            f.write(str(l) + '\n')

        self.elements.append(
            button(_('Ok'),
                   self.pos_y + self.height - 2,
                   self.pos_x + (self.width / 2),
                   align='middle'))  #2

        f.close()
Ejemplo n.º 7
0
		def layout(self):
			self.elements.append(textline(_('Please enter the password:'******'Ok'),self.pos_y+5,self.pos_x+8,12)) #2
			self.elements.append(button(_('Cancel'),self.pos_y+5,self.pos_x+(self.width)-8,align="right")) #3
			self.elements[1].set_on()
			self.current=1
Ejemplo n.º 8
0
    def layout(self):
        if self.all_results.has_key('timezone'):
            self.timezone_default = self.all_results['timezone']
        else:
            self.timezone_default = self.get_default_timezone(
                self.cmdline.get("DEFAULT_COUNTRYCODE", "DE"))

        dict, default_position, showAll = self.create_timezone_list(
            self.timezone_default)

        self.elements.append(
            textline(_('Select a time zone:'), self.minY - 11, self.minX + 5))
        self.add_elem(
            'ZONES',
            select(dict,
                   self.minY - 9,
                   self.minX + 5,
                   WIDTH,
                   HEIGHT,
                   default_position,
                   longline=1))
        self.add_elem(
            'CBX',
            checkbox({_('Show all available timezones'): ['yes', 0]},
                     self.minY - 8 + HEIGHT, self.minX + 5, WIDTH, 1, []))

        self.move_focus(self.get_elem_id('ZONES'))
Ejemplo n.º 9
0
    def profile_complete(self):

        message = _('The following value is missing: ')
        if self.check('auto_join') | self.check(
                'domain_controller_account') | self.check(
                    'domain_controller_password'):
            return False

        if self.all_results.has_key(
                'auto_join') and self.all_results['auto_join'] in [
                    'false', 'False'
                ]:
            return True

        if self.all_results['domain_controller_account'].strip() == '':
            if not self.ignore('domain_controller_account'):
                self.message = message + _('Join account')
                return False

        if self.all_results['domain_controller_password'].strip() == '':
            if not self.ignore('domain_controller_password'):
                self.message = message + _('Password')
                return False

        return True
Ejemplo n.º 10
0
 def layout(self):
     self.invalid = 0
     selected = []
     self.network = 1
     #self.elements.append(textline(_('Adding network device'),self.pos_y+1,self.pos_x+2)) #0
     self.elements.append(
         radiobutton({
             'nfs': ['nfs', 1],
             'smbfs': ['smbfs', 2]
         }, self.pos_y + 1, self.pos_x + 3, 10, 2, [1]))  #0
     self.elements.append(
         textline(_('Servername'), self.pos_y + 4, self.pos_x + 3))  #1
     self.elements.append(input('', self.pos_y + 5, self.pos_x + 3,
                                40))  #2
     self.elements.append(
         textline(_('Path'), self.pos_y + 7, self.pos_x + 3))  #3
     self.elements.append(
         input('/var/lib/univention-repository', self.pos_y + 8,
               self.pos_x + 3, 40))  #4
     self.elements.append(
         button("F12-" + _("Ok"), self.pos_y + 11, self.pos_x + 34,
                14))  #5
     self.elements.append(
         button("ESC-" + _("Cancel"), self.pos_y + 11, self.pos_x + 3,
                16))  #6
     self.current = 2
     self.elements[self.current].set_on()
Ejemplo n.º 11
0
    def layout(self):
        index = -11

        if os.path.isfile('/usr/bin/xinit'):
            msg = _(
                '''The graphical configuration frontend could not be started! To continue the reconfiguration of this system, a web browser is required.

You can access the configuration frontend by opening the following URL:

http://<ip address of this system>/umc/

After logging in as user "root",  select the module "System Setup".

The network settings (IP address) can be configured on next screen (press F12). To log in, the root password is required. If the password is unknown or should be changed, enter a new one below.

Hint: The network settings have to be confirmed before the system boot process will continue/the configuration frontend will be available.'''
            )
        else:
            msg = _(
                '''Currently no graphical frontend has been installed! To continue the reconfiguration of this system, a web browser is required.

You can access the configuration frontend by opening the following URL:

http://<ip address of this system>/umc/

After logging in as user "root",  select the module "System Setup".

The network settings (IP address) can be configured on next screen (press F12). To log in, the root password is required. If the password is unknown or should be changed, enter a new one below.

Hint: The network settings have to be confirmed before the system boot process will continue/the configuration frontend will be available.'''
            )

        msglen = 22

        # description text
        self.add_elem(
            'TEXTAREA1',
            textarea(msg, self.minY + index, self.minX + 5, msglen, 65))

        index += msglen

        # password
        self.add_elem('TXT_ROOTPW1',
                      textline(_('Root password:'******'IN_ROOTPW1',
                      password(self.all_results['root_password'],
                               self.minY + index, self.minX + 5, 30))  #11
        index += 2

        self.add_elem('TXT_ROOTPW2',
                      textline(_('Root password (retype):'), self.minY + index,
                               self.minX + 5))  #12
        index += 1
        self.add_elem('IN_ROOTPW2',
                      password(self.all_results['root_password'],
                               self.minY + index, self.minX + 5, 30))  #13
        index += 1
Ejemplo n.º 12
0
 def helptext(self):
     if self.oxae:
         return _(
             'Settings  \n \n Configuration of basic system settings like fully qualified domain name, mail domain, windows domain and root password.'
         )
     else:
         return _(
             'Settings  \n \n Configuration of basic system settings like hostname, domain name and LDAP base and root password.'
         )
Ejemplo n.º 13
0
		def layout(self):
			self.invalid=0
			self.network=0
			selected=[]
			#self.elements.append(textline(_('Adding cdrom device'),self.pos_y+1,self.pos_x+2)) #0
			self.elements.append(input('/dev/', self.pos_y+1, self.pos_x+3,30))#0
			self.elements.append(button("F12-"+_("Ok"),self.pos_y+3,self.pos_x+22,14)) #1
			self.elements.append(button("ESC-"+_("Cancel"),self.pos_y+3,self.pos_x+3,16)) #2
			self.current=0
			self.elements[self.current].set_on()
Ejemplo n.º 14
0
    def layout(self):
        index = -11

        if os.path.isfile("/usr/bin/xinit"):
            msg = _(
                """The graphical configuration frontend could not be started! To continue the reconfiguration of this system, a web browser is required.

You can access the configuration frontend by opening the following URL:

http://<ip address of this system>/umc/

After logging in as user "root",  select the module "System Setup".

The network settings (IP address) can be configured on next screen (press F12). To log in, the root password is required. If the password is unknown or should be changed, enter a new one below.

Hint: The network settings have to be confirmed before the system boot process will continue/the configuration frontend will be available."""
            )
        else:
            msg = _(
                """Currently no graphical frontend has been installed! To continue the reconfiguration of this system, a web browser is required.

You can access the configuration frontend by opening the following URL:

http://<ip address of this system>/umc/

After logging in as user "root",  select the module "System Setup".

The network settings (IP address) can be configured on next screen (press F12). To log in, the root password is required. If the password is unknown or should be changed, enter a new one below.

Hint: The network settings have to be confirmed before the system boot process will continue/the configuration frontend will be available."""
            )

        msglen = 22

        # description text
        self.add_elem("TEXTAREA1", textarea(msg, self.minY + index, self.minX + 5, msglen, 65))

        index += msglen

        # password
        self.add_elem("TXT_ROOTPW1", textline(_("Root password:"******"IN_ROOTPW1", password(self.all_results["root_password"], self.minY + index, self.minX + 5, 30)
        )  # 11
        index += 2

        self.add_elem("TXT_ROOTPW2", textline(_("Root password (retype):"), self.minY + index, self.minX + 5))  # 12
        index += 1
        self.add_elem(
            "IN_ROOTPW2", password(self.all_results["root_password"], self.minY + index, self.minX + 5, 30)
        )  # 13
        index += 1
Ejemplo n.º 15
0
	def __init__(self, parent, pos_y, pos_x, width, height, fieldtype):
		self.type = fieldtype
		if self.type == self.DOMAINDNS:
			self.name = _('Domain DNS Server')
			self.title = _(' More Domain DNS Servers')
			self.containerkey = 'nameserver_%d'
		elif self.type == self.EXTERNALDNS:
			self.name = _('External DNS Server')
			self.title = _(' More External DNS Servers')
			self.containerkey = 'dns_forwarder_%d'
		self.values = []
		subwin.__init__(self, parent, pos_y, pos_x, width, height)
Ejemplo n.º 16
0
	def layout(self):
		dict, langConfig, selectedLine, defaultLanguage = self.get_language_settings()

		if self.all_results.has_key('language'):
			self.default = self.all_results['language']
		else:
			self.default = defaultLanguage

		self.elements.append(textline(_('Select system language'),self.minY-11,self.minX+5))
		self.elements.append(textline(_('(also applies to the installation process for supported languages):'),self.minY-10,self.minX+5))
		self.add_elem('LANGUAGE',select(dict, self.minY-8, self.minX+5, WIDTH, HEIGHT, selectedLine))

		self.move_focus(self.get_elem_id('LANGUAGE'))
Ejemplo n.º 17
0
	def layout(self):
		if self.all_results.has_key('keymap'):
			default_value = self.all_results['keymap']
		else:
			default_value = self.cmdline.get("DEFAULT_LANGUAGE_EN", "German")

		dict, default_position, showAll = self.create_kmap_list(default_value)

		self.elements.append(textline(_('Select your keyboard layout:'), self.minY-11, self.minX+5))
		self.add_elem('MAPS',select(dict,self.minY-9, self.minX+5, WIDTH, HEIGHT, default_position))
		self.add_elem('CBX', checkbox({_('Show all available keyboard layouts'):' '}, self.minY-8+HEIGHT, self.minX+5, 60, 1, []))

		self.move_focus(self.get_elem_id('MAPS'))
Ejemplo n.º 18
0
	def layout(self):
		if self.all_results.has_key('timezone'):
			self.timezone_default = self.all_results['timezone']
		else:
			self.timezone_default = self.get_default_timezone(self.cmdline.get("DEFAULT_COUNTRYCODE", "DE"))

		dict, default_position, showAll = self.create_timezone_list(self.timezone_default)

		self.elements.append(textline(_('Select a time zone:'), self.minY-11, self.minX+5))
		self.add_elem('ZONES',select(dict, self.minY-9, self.minX+5, WIDTH, HEIGHT, default_position, longline=1))
		self.add_elem('CBX', checkbox({_('Show all available timezones'):['yes', 0]},self.minY-8+HEIGHT, self.minX+5, WIDTH, 1, []))

		self.move_focus(self.get_elem_id('ZONES'))
Ejemplo n.º 19
0
    def layout(self):
        self.debug('==> layout')

        self.prepare()

        status = activity(self.minY + 2, self.minX + 2, 20)

        self.debug('not has_key cdrom_device')
        self.reset_layout()
        self.std_button()
        cds = {}
        self.count = 0
        append = 0
        if not hasattr(self, 'selected'):
            self.selected = []
            append = 1

        for cd in self.container['cdrom_devices']:
            cd = cd.replace('/dev/', '')
            if cd.startswith('nfs:') or cd.startswith('smbfs:'):
                key = '%s' % cd
            else:
                key = '/dev/%s' % cd
            cds[key] = [key, self.count]
            if append:
                if not self.count in self.selected:
                    self.selected.append(self.count)
            self.count = self.count + 1

        self.elements.append(
            textline(_('Check devices for UCS CD:'), self.minY - 11,
                     self.minX + 5))  #2
        self.elements.append(
            checkbox(cds, self.minY - 9, self.minX + 5, 45, 10,
                     self.selected))  #3
        self.elements.append(
            button(_('F2-Add'), self.minY + 2, self.minX + 5,
                   align="left"))  #4
        if self.activate_network:
            self.elements.append(
                button(_('F3-Add'), self.minY + 3, self.minX + 5,
                       align="left"))  #5
        else:
            self.elements.append(dummy())
        self.elements.append(
            button(_('F4-Rescan'),
                   self.minY + 3 + self.activate_network,
                   self.minX + 5,
                   align="left"))  #6
        self.elements.append(
            textline(_('CD-ROM Device'), self.minY + 2,
                     self.minX + 12 + len(_('F2-Add'))))  #7
        if self.activate_network:
            self.elements.append(
                textline(_('Network Device'), self.minY + 3,
                         self.minX + 12 + len(_('F2-Add'))))  #8
        else:
            self.elements.append(dummy())

        self.cdrom_test = 1
Ejemplo n.º 20
0
	def update_call_master_joinscripts(self):
		selected_role = self.get_elem('RADIO').result()

		msg = ''
		if selected_role == 'domaincontroller_master':
			if self.call_master_joinscripts is None:
				msg = ''
			elif self.call_master_joinscripts:
				msg = _('Join scripts will be called during installation.')
			else:
				msg = _('Join scripts will not be called during installation.')

		idx = self.get_elem_id('CALL_MASTER_JOINSCRIPTS')
		self.elements[idx] = textline( msg, self.minY+17, self.minX+5 )
Ejemplo n.º 21
0
		def layout(self):
			self.invalid=0
			selected=[]
			self.network=1
			#self.elements.append(textline(_('Adding network device'),self.pos_y+1,self.pos_x+2)) #0
			self.elements.append(radiobutton({'nfs': ['nfs', 1],'smbfs': ['smbfs', 2]},self.pos_y+1,self.pos_x+3, 10, 2, [1])) #0
			self.elements.append(textline(_('Servername'),self.pos_y+4,self.pos_x+3)) #1
			self.elements.append(input('', self.pos_y+5, self.pos_x+3,40))#2
			self.elements.append(textline(_('Path'),self.pos_y+7,self.pos_x+3)) #3
			self.elements.append(input('/var/lib/univention-repository', self.pos_y+8, self.pos_x+3,40))#4
			self.elements.append(button("F12-"+_("Ok"),self.pos_y+11,self.pos_x+34,14)) #5
			self.elements.append(button("ESC-"+_("Cancel"),self.pos_y+11,self.pos_x+3,16)) #6
			self.current=2
			self.elements[self.current].set_on()
Ejemplo n.º 22
0
 def layout(self):
     self.invalid = 0
     self.network = 0
     selected = []
     #self.elements.append(textline(_('Adding cdrom device'),self.pos_y+1,self.pos_x+2)) #0
     self.elements.append(
         input('/dev/', self.pos_y + 1, self.pos_x + 3, 30))  #0
     self.elements.append(
         button("F12-" + _("Ok"), self.pos_y + 3, self.pos_x + 22,
                14))  #1
     self.elements.append(
         button("ESC-" + _("Cancel"), self.pos_y + 3, self.pos_x + 3,
                16))  #2
     self.current = 0
     self.elements[self.current].set_on()
Ejemplo n.º 23
0
 def layout(self):
     self.elements.append(
         textline(_('Please enter the password:'******'Ok'), self.pos_y + 5, self.pos_x + 8, 12))  #2
     self.elements.append(
         button(_('Cancel'),
                self.pos_y + 5,
                self.pos_x + (self.width) - 8,
                align="right"))  #3
     self.elements[1].set_on()
     self.current = 1
Ejemplo n.º 24
0
	def get_error_msg(self):
		msg = []
		# does error message exist?
		if os.path.isfile( fn_error_msg ):
			msg.append( _('Some problems occurred during installation!') )
			msg.append( _('Please read the following error messages carefully.') )
			msg.append( _('In case of doubt a reinstallation might be reasonable.') )
			msg.append( '' )
			try:
				lines = open(fn_error_msg,'r').readlines()
				for line in lines:
					msg.append( line.rstrip('\r\n\t ') )
			except:
				pass
		return msg
Ejemplo n.º 25
0
	def incomplete(self):
		self.debug('==> incomplete')
		if self.container.has_key('cdrom_device') and self.container['cdrom_device']:
			return 0
		else:
			self.cdrom_test=1
			return _("No valid source found")
Ejemplo n.º 26
0
	def layout(self):
		## clear layout
		self.reset_layout()
		# add default buttons
		self.std_button()

		self.find_devices()

		msg = _('This module is used to specifiy the device where to install the boot loader. The correct device depends on current BIOS settings and partitioning. If an incorrect device has been selected, the installed system may not boot. If unsure, continue without change.')
		self.add_elem('TA_desc', textarea(msg, self.minY-10, self.minX+5, 8, self.maxWidth+11))

		pos = self.minY - 10 + self.get_elem('TA_desc').get_number_of_lines()

		self.add_elem('TL_headline', textline(_('Select where to install the GRUB boot loader:'), pos + 1, self.minX+5))
		self.add_elem('DEVICE',select(self.devices, pos + 3, self.minX+5, self.max_length, 15, self.devices.get(self.selected_device,[0,0])[1]))
		self.move_focus(self.get_elem_id('DEVICE'))
Ejemplo n.º 27
0
	def update_description(self):
		descriptions = {
			'domaincontroller_master': _('The domain controller master (DC master for short) contains the original dataset for the entire LDAP directory. Changes to the LDAP directory are only performed on this server. For this reason, this must be the first system to be commissioned and there can only be one of them within a domain. In addition, the Root Certification Authority (root CA) is also on the DC master. All SSL certificates created are archived on the DC master.'),
			'domaincontroller_backup': _('Servers with the role of domain controller backup (DC backup for short) contain a replicated copy of the entire LDAP directory, which cannot be changed as all write accesses occur exclusively on the DC master. A copy of all SSL certificates including the private key of the root CA is kept on the DC backup. The DC backup is as such a backup copy of the DC master.  If the DC master should collapse completely, running a special command allows the DC backup to take over the role of the DC master permanently in a very short time.'),
			'domaincontroller_slave': _('Each domain controller slave (DC slave for short) contains a replicated copy of the entire LDAP directory, which cannot be changed as all write accesses occur on the DC master. The copy can either contain the entire directory or be limited to the files required by a location through selective replication. The DC slave only stores a copy of its own and the public SSL certificate of the root CA. A DC slave system cannot be promoted to a DC master.'),
			'memberserver': _('Member servers are members of a LDAP domain and offer services such as file storage for the domain. Member servers do not contain a copy of the LDAP directory. It only stores a copy of its own and the public SSL certificate of the root CA.'),
			'basesystem': _('A base system is an independent system. It is not a member of a domain and does not maintain trust relationships with other servers or domains. A base system is thus suitable for services which are operated outside of the trust context of the domain, such as a web server or a firewall. It is possible to configure DNS and DHCP settings for base systems via the Univention management system as long as the base system is entered as an IP managed client in the directory service.'),
			}

		# get current role
		selected_role = self.get_elem('RADIO').get_focus()[1]
		self.debug('ROLE: selected_role=%r' % selected_role)

		# overwrite existing textarea
		idx = self.get_elem_id('TEXTAREA')
		self.elements[idx] = textarea( descriptions.get(selected_role,'UNKNOWN'), self.minY-1, self.minX+6, 15, MAXLENGTH)
Ejemplo n.º 28
0
 def incomplete(self):
     self.debug('==> incomplete')
     if self.container.has_key(
             'cdrom_device') and self.container['cdrom_device']:
         return 0
     else:
         self.cdrom_test = 1
         return _("No valid source found")
Ejemplo n.º 29
0
def abort(max_x, max_y):
    text = _(
        'Press Ctrl+c to exit or any key to continue. After exiting the installer please reboot the system or press Ctrl+Alt+F2 to get an shell prompt.'
    )
    message = objects.warning(text, max_y, max_x)
    message.draw()
    c = stdscr.getch()
    return 0
Ejemplo n.º 30
0
	def layout(self):
		MAXIP = LEN_IPv6_ADDR + 3

		self.get_values()

		# 1. Nameserver/DNS-Fwd
		self.add_elem('TXT1', textline( _('1. %s') % self.name, self.pos_y+2, self.pos_x+2))
		self.add_elem('TXT2', textline( _('2. %s') % self.name, self.pos_y+3, self.pos_x+2))
		self.add_elem('TXT3', textline( _('3. %s') % self.name, self.pos_y+4, self.pos_x+2))
		self.add_elem('VALUE1', textline(self.values[0][:LEN_IPv6_ADDR+1], self.pos_y+2, self.pos_x+30))  # limit length of IP address
		self.add_elem('VALUE2', input(self.values[1], self.pos_y+3, self.pos_x+29, MAXIP))
		self.add_elem('VALUE3', input(self.values[2], self.pos_y+4, self.pos_x+29, MAXIP))

		self.add_elem('BTN_CANCEL', button('ESC-'+_('Cancel'), self.pos_y+7, self.pos_x+8))
		self.add_elem('BTN_OK', button('F12-'+_('Ok'), self.pos_y+7, self.pos_x+(self.width)-8, 13, align="right"))

		self.current = self.get_elem_id('VALUE2')
		self.elements[self.current].set_on()
Ejemplo n.º 31
0
	def incomplete(self, what=''):
		if not what:
			if self.elements[3].usable() and self.getfile(self.elements[3].result()[0])[1] == 'FILE':
				file=os.path.join(self.currentpath,self.getfile(self.elements[3].result()[0])[0])
				return 0
			else:
				return _('You have to select a Profile.')
		else:
			return what
Ejemplo n.º 32
0
	def incomplete(self):
		missing = _('The following value is missing: ')
		invalid = _('The following value is invalid: ')

		# check for valid IP address
		for i in xrange(2,3+1):
			val = self.get_elem('VALUE%d' % i).result().strip()
			# IP address has to meet IPv4 or IPv6 syntax AND
			# values like "0.0.0.0", "255.255.255.255" and "::" are not allowed
			if val and not(self.parent.is_ipaddr(val) and val != '0.0.0.0' and val != '255.255.255.255' and val != '::'):
				return '%s%d. %s' % (invalid, i, self.name)
			self.values[i-1] = val

		# check if first and third value is set
		if self.values[2] and not self.values[1]:
			return '%s%d. %s' % (missing, 2, self.name)

		return None
Ejemplo n.º 33
0
	def profile_complete(self):
		self.debug('==> profile_complete')
		if self.check('cdrom_device'):
			return False
		if self.container.has_key('cdrom_device') and self.container['cdrom_device']:
			return True
		if self.ignore('cdrom_device'):
			return True
		self.message=_("No valid source found")
		return False
Ejemplo n.º 34
0
	def layout(self):
		status = activity(self.minY+2,self.minX+2,20)

		self.reset_layout()
		self.std_button()
		selected=[]

		if not hasattr(self, 'files'):
			# Profil installation profile_check returned false, need to run def start()
			self.start()

		text='%-32s%18s'%(_('Filename'),_('Size'))#52 zeichen!

		self.elements.append(textline(text,self.pos_y+2,self.pos_x+6)) #2
		self.elements.append(select(self.files,self.pos_y+3,self.pos_x+6,52,17)) #3

		self.elements[self.current].set_off()
		self.current=3
		self.elements[3].set_on()
Ejemplo n.º 35
0
	def draw_info(self):
		# redraw disabled by show_ending_msg()
		if self.redraw_blocked:
			return

		# update info window
		self.infowin.bkgd(curses.color_pair(1))
		self.infowin.box()

		msg = _('''Congratulations! The installation of %(name)s is currently running.

Base information of local system:
  Hostname:      %(hostname)s
  System role:   %(systemrole)s
  IP address:    %(address)s


Please visit the following websites to learn more about %(name)s:

- Quickstart Guide:
  http://wiki.univention.de/index.php?title=UCS_Quickstart/en

- Manuals and further information:
  http://www.univention.de/en/download/documentation/

- Forum:
  http://forum.univention.de

- Support & Knowledge Base:
  http://sdb.univention.de
''') % { 'name': self.options.name,
		 'hostname': '%s.%s' % (self.profile.get('hostname','unknown'), self.profile.get('domainname','example.com')),
		 'systemrole': systemrole2name[ self.profile.get('system_role','domaincontroller_master') ],
		 'address': self.profile.get('hostaddress', _('dynamic')),
		 }

		y = 2
		for line in msg.split('\n'):
			self.infowin.addstr(y, 3, line)
			y += 1

		self.infowin.refresh()
Ejemplo n.º 36
0
	def profile_complete(self):

		message=_('The following value is missing: ')
		if self.check('auto_join') | self.check('domain_controller_account') | self.check('domain_controller_password'):
			return False

		if self.all_results.has_key('auto_join') and self.all_results['auto_join'] in ['false', 'False']:
			return True

		if self.all_results['domain_controller_account'].strip() == '':
			if not self.ignore('domain_controller_account'):
				self.message=message+_('Join account')
				return False

		if self.all_results['domain_controller_password'].strip() == '':
			if not self.ignore('domain_controller_password'):
				self.message=message+_('Password')
				return False

		return True
Ejemplo n.º 37
0
 def profile_complete(self):
     self.debug('==> profile_complete')
     if self.check('cdrom_device'):
         return False
     if self.container.has_key(
             'cdrom_device') and self.container['cdrom_device']:
         return True
     if self.ignore('cdrom_device'):
         return True
     self.message = _("No valid source found")
     return False
Ejemplo n.º 38
0
 def incomplete(self, what=''):
     if not what:
         if self.elements[3].usable() and self.getfile(
                 self.elements[3].result()[0])[1] == 'FILE':
             file = os.path.join(
                 self.currentpath,
                 self.getfile(self.elements[3].result()[0])[0])
             return 0
         else:
             return _('You have to select a Profile.')
     else:
         return what
Ejemplo n.º 39
0
    def layout(self):
        status = activity(self.minY + 2, self.minX + 2, 20)

        self.reset_layout()
        self.std_button()
        selected = []

        if not hasattr(self, 'files'):
            # Profil installation profile_check returned false, need to run def start()
            self.start()

        text = '%-32s%18s' % (_('Filename'), _('Size'))  #52 zeichen!

        self.elements.append(textline(text, self.pos_y + 2,
                                      self.pos_x + 6))  #2
        self.elements.append(
            select(self.files, self.pos_y + 3, self.pos_x + 6, 52, 17))  #3

        self.elements[self.current].set_off()
        self.current = 3
        self.elements[3].set_on()
Ejemplo n.º 40
0
	def get_success_msg(self):
		msg = []
		if os.path.isfile( fn_success_msg ):
			msg.append( _('The installation has been finished successfully!') )
			msg.append( '' )
			try:
				lines = open(fn_success_msg,'r').readlines()
				for line in lines:
					msg.append( line.rstrip('\r\n\t ') )
			except:
				pass
		return msg
Ejemplo n.º 41
0
    def footer(self, last):
        if last[0] == 0:  # first
            if last[1] == 0:  # last
                if self.cmdline.has_key('recover') and self.cmdline['recover']:
                    text = _(
                        ' F1-Help | F12-Start Recover Shell | Strg+c-Exit')
                else:
                    text = _(' F1-Help | F12-Start Installation | Strg+c-Exit')
            elif last[1] == 1:  # not last
                text = _(' F1-Help | F12-Next | Strg+c-Exit')
        elif last[0] == 1:  # not first
            if last[1] == 0:  # last
                if self.cmdline.has_key('recover') and self.cmdline['recover']:
                    text = _(
                        ' F1-Help | F11-Back | F12-Start Recover Shell | Strg+c-Exit'
                    )
                else:
                    text = _(
                        ' F1-Help | F11-Back | F12-Start Installation | Strg+c-Exit'
                    )
            elif last[1] == 1:  # not last
                text = _(' F1-Help | F11-Back | F12-Next | Strg+c-Exit')

        return objects.footline(text, max_y / 2 + 18,
                                max_x / 2 - (len(text) / 2))
Ejemplo n.º 42
0
    def profile_prerun(self):
        self.debug('==> profile_prerun')
        if self.cmdline.has_key('nfsserver') and self.cmdline.has_key(
                'nfspath'):
            self.container['cdrom_device'] = 'nfs:%s:%s' % (
                self.cmdline['nfsserver'], self.cmdline['nfspath'])
        else:
            if self.ignore('cdrom_device'):
                return
            self.sub = self.active(self, _('Searching CD-ROM Drive'),
                                   _('Please wait ...'))
            self.sub.action = 'cdrom-search'
            self.sub.draw()
            self.prepare()
            self.debug('self.container=%s' % self.container)

        if self.ignore('cdrom_device'):
            return

        self.sub = self.active(self, _('Testing CD-ROM Drive'),
                               _('Please wait ...'))
        self.sub.action = 'cdrom-test-profile'
        self.sub.draw()
        self.debug('self.container=%s' % self.container)

        #prepare cdrom
        self.sub = self.active(self, _('Mounting CD-ROM Drive'),
                               _('Please wait ...'))
        self.sub.action = 'cdrom-prepare'
        self.sub.draw()
        self.debug('self.container=%s' % self.container)
Ejemplo n.º 43
0
	def profile_prerun(self):
		self.debug('==> profile_prerun')
		if self.cmdline.has_key('nfsserver') and self.cmdline.has_key('nfspath'):
			self.container['cdrom_device']='nfs:%s:%s' % (self.cmdline['nfsserver'], self.cmdline['nfspath'])
		else:
			if self.ignore('cdrom_device'):
				return
			self.sub = self.active(self,_('Searching CD-ROM Drive'),_('Please wait ...'))
			self.sub.action='cdrom-search'
			self.sub.draw()
			self.prepare()
			self.debug('self.container=%s' % self.container)

		if self.ignore('cdrom_device'):
			return

		self.sub = self.active(self,_('Testing CD-ROM Drive'),_('Please wait ...'))
		self.sub.action='cdrom-test-profile'
		self.sub.draw()
		self.debug('self.container=%s' % self.container)

		#prepare cdrom
		self.sub = self.active(self,_('Mounting CD-ROM Drive'),_('Please wait ...'))
		self.sub.action='cdrom-prepare'
		self.sub.draw()
		self.debug('self.container=%s' % self.container)
Ejemplo n.º 44
0
	def incomplete(self):
		p_list=[]
		s3 = s4 = None
		kvm = xen = None

		for c in self.categories.keys():
			index=self.categories[c][1]
			for key in self.packages[index].keys():
				if self.packages[index][key][2] == 1:
					for p in self.packages[index][key][4]:
						if p == 'univention-samba':
							s3 = (index, key)
						elif p == 'univention-samba4':
							s4 = (index, key)
						elif p == 'univention-virtual-machine-manager-node-kvm':
							kvm = (index, key)
						elif p == 'univention-virtual-machine-manager-node-xen':
							xen = (index, key)
						p_list.append(p)

		if xen and kvm:
			return _('Software conflict!\n\nIt is not allowed to install the software packages %s and %s on one system. Please select only one of these two component.') % (self.packages[kvm[0]][kvm[1]][0], self.packages[xen[0]][xen[1]][0])

		if s3 and s4:
			return _('Software conflict!\n\nIt is not allowed to install the software packages %s and %s on one system. Please select only one of these two component.') % (self.packages[s4[0]][s4[1]][0], self.packages[s3[0]][s3[1]][0])

		if self.all_results['system_role'] in ['domaincontroller_backup', 'domaincontroller_slave']:
			if s3 and self.samba3_warning == False:
				self.samba3_warning = True
				return _('The software package %s was selected. It is not possible to mix NT and Active Directory compatible domaincontroller.\n\nMake sure the existing UCS domain is NT-compatible (Samba 3). This warning is shown only once. The installation can be continued with this selection.') % (self.packages[s3[0]][s3[1]][0])

			if s4 and self.samba4_warning == False:
				if self.all_results['system_role'] in ['domaincontroller_backup', 'domaincontroller_slave']:
					self.samba4_warning = True
					return _('The software package %s was selected. It is not possible to mix NT and Active Directory compatible domaincontroller.\n\nMake sure the existing UCS domain is Active Directory-compatible (Samba 4). This warning is shown only once. The installation can be continued with this selection.') % (self.packages[s4[0]][s4[1]][0])

		return 0
Ejemplo n.º 45
0
Archivo: main.py Proyecto: B-Rich/smart
	def layout(self):
		dict={}
		self.elements.append(textline(_('A Python Exception has occured!'),self.pos_y+2,self.pos_x+2)) #0

		debug( str( self.comment ) )
		i = 0
		for line in self.comment:
			obj = textline( line, self.pos_y + 3 + i, self.pos_x + 2 )
			i += 1
			self.elements.append( obj )

		count=i
		f=open('/tmp/installation.error', 'a+')
		for l in self.message:
			l=l.replace('\n','')
			l=l.replace('\r','')
			l=l.strip(' ')
			self.elements.append(textline(l[:self.message_width],self.pos_y+4+count,self.pos_x+2)) #2...
			count=count+1
			f.write(str(l)+'\n')

		self.elements.append(button(_('Ok'),self.pos_y+self.height-2,self.pos_x+(self.width/2),align='middle')) #2

		f.close()
Ejemplo n.º 46
0
Archivo: end.py Proyecto: B-Rich/smart
def main():
	# get and set language
	if os.path.isfile(language_file):
		language = linecache.getline(language_file, 1).strip('\n')
		os.environ['LANGUAGE'] = language

	msg = []
	# does error message exist?
	if os.path.isfile( fn_error_msg ):
		msg.append( _('Some problems occurred during installation!') )
		msg.append( _('Please read the following error messages carefully.') )
		msg.append( _('In case of doubt a reinstallation might be reasonable.') )
		msg.append( '' )
		try:
			lines = open(fn_error_msg,'r').readlines()
			for line in lines:
				msg.append( line.rstrip('\r\n\t ') )
		except:
			pass

	# does success msg exist?
	elif os.path.isfile( fn_success_msg ):
		msg.append( _('The installation has been finished successfully!') )
		msg.append( '' )
		try:
			lines = open(fn_success_msg,'r').readlines()
			for line in lines:
				msg.append( line.rstrip('\r\n\t ') )
		except:
			pass

	else:
		msg = createSuccessMsg()

	win = MsgWindow( msg )
	win.run()
Ejemplo n.º 47
0
def main():
    # get and set language
    if os.path.isfile(language_file):
        language = linecache.getline(language_file, 1).strip('\n')
        os.environ['LANGUAGE'] = language

    msg = []
    # does error message exist?
    if os.path.isfile(fn_error_msg):
        msg.append(_('Some problems occurred during installation!'))
        msg.append(_('Please read the following error messages carefully.'))
        msg.append(_('In case of doubt a reinstallation might be reasonable.'))
        msg.append('')
        try:
            lines = open(fn_error_msg, 'r').readlines()
            for line in lines:
                msg.append(line.rstrip('\r\n\t '))
        except:
            pass

    # does success msg exist?
    elif os.path.isfile(fn_success_msg):
        msg.append(_('The installation has been finished successfully!'))
        msg.append('')
        try:
            lines = open(fn_success_msg, 'r').readlines()
            for line in lines:
                msg.append(line.rstrip('\r\n\t '))
        except:
            pass

    else:
        msg = createSuccessMsg()

    win = MsgWindow(msg)
    win.run()
Ejemplo n.º 48
0
	def layout(self):
		self.oxae = (self.cmdline.get('edition') and self.cmdline['edition'][0] == 'oxae')

		index = -11

		fqdn = ''
		if self.all_results['hostname'] or self.all_results['domainname']:
			fqdn = '%s.%s' % (self.all_results['hostname'], self.all_results['domainname'])

		# fqdn
		self.add_elem('TXT_FQDN',
			textline(_('Fully qualified domain name (e.g. host.example.com):'), self.minY+index, self.minX+5))#2
		index += 1
		self.add_elem('IN_FQDN', input(fqdn, self.minY+index, self.minX+5,30))#3
		index += 2

		# oxae maildomain
		if self.oxae:
			self.add_elem('TXT_MAILDOMAIN',
				textline(_('Mail domain (e.g. example.com):'), self.minY+index, self.minX+5))#4
			index += 1
			self.add_elem('IN_MAILDOMAIN',
				input(self.all_results.get('ox_primary_maildomain',''), self.minY+index, self.minX+5,30))#5
			index += 2

		# ucs ldap base
		if self.all_results.has_key('system_role') and self.all_results['system_role'] == 'domaincontroller_master':
			if not self.oxae:
				self.add_elem('TXT_LDAPBASE',
					textline(_('LDAP base:'), self.minY+index, self.minX+5))#6
				index += 1
				self.add_elem('IN_LDAPBASE',
					input(self.all_results['ldap_base'], self.minY+index, self.minX+5,30))#7
				index += 2
				if self.all_results.has_key('ldap_base') and self.all_results['ldap_base']:
					self.guessed[ 'ldap_base' ] = self.all_results['ldap_base']+'already_initialize'

		# windom
		self.add_elem('TXT_WINDOMAIN', textline(_('Windows domain name:'), self.minY+index, self.minX+5))#8
		index += 1
		self.add_elem('IN_WINDOMAIN', input(self.all_results['windows_domain'], self.minY+index, self.minX+5,30))#9
		index += 2
		if self.all_results.has_key('windows_domain') and self.all_results['windows_domain']:
			self.guessed[ 'windows_domain' ] = self.all_results['windows_domain']+'already_initialize'

		# password
		self.add_elem('TXT_ROOTPW1', textline(_('Root password:'******'IN_ROOTPW1', password(self.all_results['root_password'],self.minY+index,self.minX+5,30)) #11
		index += 2

		self.add_elem('TXT_ROOTPW2', textline(_('Root password (retype):'),self.minY+index,self.minX+5)) #12
		index += 1
		self.add_elem('IN_ROOTPW2', password(self.all_results['root_password'],self.minY+index,self.minX+5,30)) #13
		index += 1
Ejemplo n.º 49
0
	def layout(self):
		self.debug('==> layout')

		self.prepare()

		status = activity(self.minY+2,self.minX+2,20)

		self.debug('not has_key cdrom_device')
		self.reset_layout()
		self.std_button()
		cds={}
		self.count=0
		append=0
		if not hasattr(self,'selected'):
			self.selected=[]
			append=1

		for cd in self.container['cdrom_devices']:
			cd=cd.replace('/dev/','')
			if cd.startswith('nfs:') or cd.startswith('smbfs:'):
				key = '%s' % cd
			else:
				key = '/dev/%s' % cd
			cds[ key ]=[ key, self.count ]
			if append:
				if not self.count in self.selected:
					self.selected.append(self.count)
			self.count=self.count+1

		self.elements.append(textline(_('Check devices for UCS CD:'),self.minY-11,self.minX+5)) #2
		self.elements.append(checkbox(cds, self.minY-9, self.minX+5, 45, 10, self.selected)) #3
		self.elements.append(button(_('F2-Add'), self.minY+2, self.minX+5, align="left")) #4
		if self.activate_network:
			self.elements.append(button(_('F3-Add'), self.minY+3, self.minX+5, align="left")) #5
		else:
			self.elements.append( dummy() )
		self.elements.append(button(_('F4-Rescan'), self.minY+3+self.activate_network, self.minX+5, align="left")) #6
		self.elements.append(textline(_('CD-ROM Device'), self.minY+2, self.minX+12+len(_('F2-Add')))) #7
		if self.activate_network:
			self.elements.append(textline(_('Network Device'), self.minY+3, self.minX+12+len(_('F2-Add')))) #8
		else:
			self.elements.append( dummy() )

		self.cdrom_test=1
Ejemplo n.º 50
0
Archivo: main.py Proyecto: B-Rich/smart
	def __init__(self,parent,pos_y,pos_x,width,height, message):
		self.message=message
		self.message_width = width - 4
		text = _( 'This error message is shown when an unexpected error occures '
				'during the installation process. The best way is to reboot '
				'the computer and retry the installation. Confirming this '
				'message will restart the installation process without '
				'rebooting.' )
		self.comment = []
		i = 0
		while len( text ) > width - 4:
			end = text.rfind( ' ', 0, width - 4 )
			i += 1
			self.comment.append( text[ : end ] )
			text= text[ end + 1 : ]
		self.comment.append( text[ : end ] )
		height += i
		y = ( max_y - height ) / 2
		subwin.__init__( self,parent, y, pos_x, width, height )
Ejemplo n.º 51
0
 def __init__(self, parent, pos_y, pos_x, width, height, message):
     self.message = message
     self.message_width = width - 4
     text = _(
         'This error message is shown when an unexpected error occures '
         'during the installation process. The best way is to reboot '
         'the computer and retry the installation. Confirming this '
         'message will restart the installation process without '
         'rebooting.')
     self.comment = []
     i = 0
     while len(text) > width - 4:
         end = text.rfind(' ', 0, width - 4)
         i += 1
         self.comment.append(text[:end])
         text = text[end + 1:]
     self.comment.append(text[:end])
     height += i
     y = (max_y - height) / 2
     subwin.__init__(self, parent, y, pos_x, width, height)
Ejemplo n.º 52
0
	def __init__(self, options):
		self.options = options
		self.fd_read = None
		self.fd_write = None
		self.thread = None
		# during installation, logfile changes from installer.log to /instmnt/.../installation.log
		self.logfile = '/tmp/installer.log'
		self.width = MAX_WIDTH
		self.height = 9
		self.inbuffer = ''
		self.redraw_blocked = False
		self.progress = 0   # progress starts at 0%
		self.progress_msg = ''  # messages like "Unpacking foobar" returned by apt-get
		self.script_msg = _('Preparing installation') # headlines returned by each script
		self.default_percentage = 0.5
		self.current_script = None
		self.profile = {}
		self.win = None
		self.infowin = None
		self.script2progress = { '10_debootstrap.sh': ProgressInfo( percentage=4, steps=1, triggerlist = [ re.compile('^I: (Configuring|Unpacking|Extracting|Retrieving|Validating) ') ] ),
								 '25_install_config_registry.sh': ProgressInfo( percentage=4, steps=1, triggerlist = [ re.compile('^pmstatus:[^:]+:[.\d]+:(?:Installing|Unpacking|Installed) [^ ]+$'),
																													   re.compile('^pmstatus:[^:]+:[.\d]+:[^ ]+ (?:wird installiert|wird entpackt|installiert)$') ] ),
								 '35_kernel.sh': ProgressInfo( percentage=4, steps=1, triggerlist = [ re.compile('^pmstatus:[^:]+:[.\d]+:(?:Installing|Unpacking|Installed) [^ ]+$'),
																									  re.compile('^pmstatus:[^:]+:[.\d]+:[^ ]+ (?:wird installiert|wird entpackt|installiert)$') ] ),
								 '50_packages.sh': ProgressInfo( percentage=-1, steps=1, triggerlist = [ re.compile('^pmstatus:[^:]+:[.\d]+:(?:Installing|Unpacking|Installed) [^ ]+$'),
																										 re.compile('^pmstatus:[^:]+:[.\d]+:[^ ]+ (?:wird installiert|wird entpackt|installiert)$') ] ),
								 '75_join.sh': ProgressInfo( percentage=5, steps=1, triggerlist = [ re.compile('^__JOINSCRIPT__ ') ] ),
								 }
		# set dialog title
		self.title = options.name
		if options.version:
			self.title = '%s %s' % (self.title, options.version)
		if options.extension:
			self.title = '%s %s' % (self.title, options.extension)
		if options.codename:
			self.title = '%s (%s)' % (self.title, options.codename)
		self.title = '[ %s ]' % self.title

		self.read_installation_profile()