summaryrefslogtreecommitdiffstats
path: root/ipapython/sysrestore.py
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-09-13 00:01:23 +0300
committerMartin Kosek <mkosek@redhat.com>2011-09-13 11:34:43 +0200
commitb73b0178971a0547ba72a9fdfaa85ad4cfa1cacf (patch)
tree1f8465b74e8b483334785788068d64c764b08ea8 /ipapython/sysrestore.py
parentd4a28518733ec1c387469e05e4cda8a1ce8dd4d9 (diff)
downloadfreeipa-b73b0178971a0547ba72a9fdfaa85ad4cfa1cacf.tar.gz
freeipa-b73b0178971a0547ba72a9fdfaa85ad4cfa1cacf.tar.xz
freeipa-b73b0178971a0547ba72a9fdfaa85ad4cfa1cacf.zip
Introduce platform-specific adaptation for services used by FreeIPA.
Refactor FreeIPA code to allow abstracting all calls to external processes and dependencies on modification of system-wide configuration. A platform provider would give its own implementation of those methods and FreeIPA would use it based on what's built in packaging process. https://fedorahosted.org/freeipa/ticket/1605
Diffstat (limited to 'ipapython/sysrestore.py')
-rw-r--r--ipapython/sysrestore.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipapython/sysrestore.py b/ipapython/sysrestore.py
index 1025449c2..9b0e39fcb 100644
--- a/ipapython/sysrestore.py
+++ b/ipapython/sysrestore.py
@@ -32,6 +32,7 @@ import random
import string
from ipapython import ipautil
+from ipapython import services as ipaservices
SYSRESTORE_PATH = "/tmp"
SYSRESTORE_INDEXFILE = "sysrestore.index"
@@ -165,7 +166,7 @@ class FileStore:
os.chown(path, int(uid), int(gid))
os.chmod(path, int(mode))
- ipautil.run(["/sbin/restorecon", path])
+ ipaservices.restore_context(path)
del self.files[filename]
self.save()
@@ -196,7 +197,7 @@ class FileStore:
os.chown(path, int(uid), int(gid))
os.chmod(path, int(mode))
- ipautil.run(["/sbin/restorecon", path])
+ ipaservices.restore_context(path)
#force file to be deleted
self.files = {}