mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Added exception handling. Checking gpupdate.timer status.
This commit is contained in:
parent
07662349ca
commit
8420f50f9c
@ -49,9 +49,13 @@ class systemd_unit:
|
||||
service_state = self._get_state()
|
||||
|
||||
if not service_state in ['active', 'activating']:
|
||||
logdata = dict()
|
||||
logdata['unit'] = self.unit_name
|
||||
log('E46', logdata)
|
||||
service_timer_name = self.unit_name.replace(".service", ".timer")
|
||||
self.unit = self.manager.LoadUnit(dbus.String(service_timer_name))
|
||||
service_state = self._get_state()
|
||||
if not service_state in ['active', 'activating']:
|
||||
logdata = dict()
|
||||
logdata['unit'] = self.unit_name
|
||||
log('E46', logdata)
|
||||
else:
|
||||
self.manager.StopUnit(self.unit_name, 'replace')
|
||||
self.manager.DisableUnitFiles([self.unit_name], dbus.Boolean(False))
|
||||
|
@ -81,8 +81,12 @@ class cups_applier(applier_frontend):
|
||||
if not is_rpm_installed('cups'):
|
||||
log('W9')
|
||||
return
|
||||
|
||||
self.cups_connection = cups.Connection()
|
||||
try:
|
||||
self.cups_connection = cups.Connection()
|
||||
except Exception as exc:
|
||||
logdata = dict()
|
||||
logdata['exc', exc]
|
||||
log('W20', logdata)
|
||||
self.printers = storage_get_printers(self.storage, self.storage.get_info('machine_sid'))
|
||||
|
||||
if self.printers:
|
||||
|
@ -898,6 +898,9 @@ msgstr "Не удалось открыть настройки KDE"
|
||||
msgid "Failed to change KDE configuration file"
|
||||
msgstr "Не удалось изменить файл конфигурации KDE"
|
||||
|
||||
msgid "Error connecting to server"
|
||||
msgstr "Ошибка при подключении к серверу"
|
||||
|
||||
# Fatal
|
||||
msgid "Unable to refresh GPO list"
|
||||
msgstr "Невозможно обновить список объектов групповых политик"
|
||||
|
@ -339,6 +339,7 @@ def warning_code(code):
|
||||
warning_ids[17] = 'Could not find application tools'
|
||||
warning_ids[18] = 'Failed to open KDE settings'
|
||||
warning_ids[19] = 'Failed to change KDE configuration file'
|
||||
warning_ids[20] = 'Error connecting to server'
|
||||
|
||||
return warning_ids.get(code, 'Unknown warning code')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user