Univention Bugzilla – Attachment 8295 Details for
Bug 43009
UCS@school installer should check UCS@school version of DC master
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
43009.patch (text/plain), 4.61 KB, created by
Florian Best
on 2016-12-08 14:34:28 CET
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-12-08 14:34:28 CET
Size:
4.61 KB
patch
obsolete
>diff --git a/ucs-school-umc-installer/umc/python/schoolinstaller/__init__.py b/ucs-school-umc-installer/umc/python/schoolinstaller/__init__.py >index a8ecda1..0ac0ec9 100644 >--- a/ucs-school-umc-installer/umc/python/schoolinstaller/__init__.py >+++ b/ucs-school-umc-installer/umc/python/schoolinstaller/__init__.py >@@ -45,6 +45,7 @@ > import select > import errno > from httplib import HTTPException >+from distutils.version import LooseVersion > > import notifier > import notifier.threads >@@ -352,7 +353,7 @@ def get_samba_version(self): > return 3 > return None > >- def get_ucs_school_version(self): >+ def get_ucs_school_environment(self): > '''Returns 'singlemaster', 'multiserver', or None''' > if self.package_manager.is_installed('ucs-school-singlemaster'): > return 'singlemaster' >@@ -360,6 +361,9 @@ def get_ucs_school_version(self): > return 'multiserver' > return None > >+ def get_school_version(self): >+ return ucr.get('appcenter/apps/ucsschool/version') >+ > @simple_response > def query(self, **kwargs): > """Returns a dictionary of initial values for the form.""" >@@ -369,7 +373,7 @@ def query(self, **kwargs): > 'server_role': ucr.get('server/role'), > 'joined': os.path.exists('/var/univention-join/joined'), > 'samba': self.get_samba_version(), >- 'ucsschool': self.get_ucs_school_version(), >+ 'ucsschool': self.get_ucs_school_environment(), > 'guessed_master': get_master_dns_lookup(), > 'hostname': ucr.get('hostname'), > } >@@ -451,18 +455,19 @@ def _get_schoolinfo(self, school_ou): > educational_slaves = [SchoolDCSlave.from_dn(dn, None, lo).name for dn in school.educational_servers] > administrative_slaves = [SchoolDCSlave.from_dn(dn, None, lo).name for dn in school.administrative_servers] > >- school_version = None >+ school_environment = None > for package, version in (('ucs-school-singlemaster', 'singlemaster'), ('ucs-school-slave', 'multiserver'), ('ucs-school-master', 'multiserver')): > package = self.package_manager.get_package(package) > if package and package.is_installed: >- school_version = version >+ school_environment = version > break > > return { > 'exists': exists, > 'school': school_ou, > 'samba': self.get_samba_version(), >- 'school_version': school_version, >+ 'school_version': school_environment, >+ 'school_app_version': self.get_school_version(), > 'classShareServer': class_share_server, > 'homeShareServer': home_share_server, > 'educational_slaves': educational_slaves, >@@ -533,16 +538,23 @@ def install(self, request): > # check for a compatible environment on the DC master > > schoolinfo = self._get_schoolinfo_from_master(username, password, master, school_ou) >- school_version = schoolinfo['school_version'] >- if not school_version: >+ school_environment = schoolinfo['school_version'] >+ if not school_environment: > raise SchoolInstallerError(_('Please install UCS@school on the master domain controller system. Cannot proceed installation on this system.')) >- if server_role == 'domaincontroller_slave' and school_version != 'multiserver': >+ if server_role == 'domaincontroller_slave' and school_environment != 'multiserver': > raise SchoolInstallerError(_('The master domain controller is not configured for a UCS@school multi server environment. Cannot proceed installation on this system.')) >- if server_role == 'domaincontroller_backup' and school_version != setup: >+ if server_role == 'domaincontroller_backup' and school_environment != setup: > raise SchoolInstallerError(_('The UCS@school master domain controller needs to be configured similarly to this backup system. Please choose the correct environment type for this system.')) > if server_role == 'domaincontroller_backup' and not joined: > raise SchoolInstallerError(_('In order to install UCS@school on a backup domain controller, the system needs to be joined first.')) > >+ school_version = schoolinfo.get('school_app_version') >+ local_school_version = self.get_school_version() >+ if not school_version or LooseVersion(school_version) < LooseVersion(local_school_version): >+ if not ucr.is_true('ucsschool/join/ignore-version-mismatch/%s/%s' % (school_version, local_school_version)): >+ raise SchoolInstallerError(_('The version of the UCS@school app on the DC master is lower than the version on this host. Please consult the Univention Support Database on how to proceed: http://sdb.univention.de/1373')) >+ MODULE.warn('Ignoring UCS@school version mismatch: Master: %s; Local: %s;' % (school_version, local_school_version)) >+ > # everything ok, try to acquire the lock for the package installation > lock_aquired = self.package_manager.lock(raise_on_fail=False) > if not lock_aquired:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43009
:
8295
|
8296