mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Load sysupgrade.state on demand.
This prevents SELinux denials when the sysupgrade module is imported in a confined process. Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
031096324d
commit
baa665fe40
@ -27,17 +27,25 @@ from ipapython.ipa_log_manager import *
|
|||||||
STATEFILE_DIR = paths.STATEFILE_DIR
|
STATEFILE_DIR = paths.STATEFILE_DIR
|
||||||
STATEFILE_FILE = 'sysupgrade.state'
|
STATEFILE_FILE = 'sysupgrade.state'
|
||||||
|
|
||||||
_sstore = sysrestore.StateFile(STATEFILE_DIR, STATEFILE_FILE)
|
_sstore = None
|
||||||
|
|
||||||
|
def _load_sstore():
|
||||||
|
global _sstore
|
||||||
|
if _sstore is None:
|
||||||
|
_sstore = sysrestore.StateFile(STATEFILE_DIR, STATEFILE_FILE)
|
||||||
|
|
||||||
def get_upgrade_state(module, state):
|
def get_upgrade_state(module, state):
|
||||||
|
_load_sstore()
|
||||||
global _sstore
|
global _sstore
|
||||||
return _sstore.get_state(module, state)
|
return _sstore.get_state(module, state)
|
||||||
|
|
||||||
def set_upgrade_state(module, state, value):
|
def set_upgrade_state(module, state, value):
|
||||||
|
_load_sstore()
|
||||||
global _sstore
|
global _sstore
|
||||||
_sstore.backup_state(module, state, value)
|
_sstore.backup_state(module, state, value)
|
||||||
|
|
||||||
def remove_upgrade_state(module, state):
|
def remove_upgrade_state(module, state):
|
||||||
|
_load_sstore()
|
||||||
global _sstore
|
global _sstore
|
||||||
_sstore.delete_state(module, state)
|
_sstore.delete_state(module, state)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user