summaryrefslogtreecommitdiffstats
path: root/pyanaconda/desktop.py
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2011-08-22 12:33:26 +0200
committerAles Kozumplik <akozumpl@redhat.com>2011-08-26 10:26:55 +0200
commit3e8d08cac6aa89f001c5b32dba251a62a45ed7f4 (patch)
tree43e95ebdc7db0d14c92c58d6c74df4f534866300 /pyanaconda/desktop.py
parent0c662ebeaf4043ff2e2a1f7d09b527f4bf243047 (diff)
downloadanaconda-3e8d08cac6aa89f001c5b32dba251a62a45ed7f4.tar.gz
anaconda-3e8d08cac6aa89f001c5b32dba251a62a45ed7f4.tar.xz
anaconda-3e8d08cac6aa89f001c5b32dba251a62a45ed7f4.zip
Remove unnecessary ROOT_PATH constant passing.
This is a hefty and tedious change.
Diffstat (limited to 'pyanaconda/desktop.py')
-rw-r--r--pyanaconda/desktop.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pyanaconda/desktop.py b/pyanaconda/desktop.py
index bc6f94923..263c543a2 100644
--- a/pyanaconda/desktop.py
+++ b/pyanaconda/desktop.py
@@ -21,6 +21,7 @@
import string, os
from simpleconfig import SimpleConfigFile
+from pyanaconda.constants import ROOT_PATH
import logging
log = logging.getLogger("anaconda")
@@ -48,20 +49,20 @@ class Desktop (SimpleConfigFile):
SimpleConfigFile.__init__ (self)
self.runlevel = 3
- def write (self, instPath):
+ def write(self):
if self.getDefaultDesktop():
- f = open(instPath + "/etc/sysconfig/desktop", "w")
+ f = open(ROOT_PATH + "/etc/sysconfig/desktop", "w")
f.write(str (self))
f.close()
try:
- inittab = open (instPath + '/etc/inittab', 'r')
+ inittab = open (ROOT_PATH + '/etc/inittab', 'r')
except IOError:
log.warning ("there is no inittab, bad things will happen!")
return
lines = inittab.readlines ()
inittab.close ()
- inittab = open (instPath + '/etc/inittab', 'w')
+ inittab = open (ROOT_PATH + '/etc/inittab', 'w')
for line in lines:
if len (line) > 3 and line[:3] == "id:":
fields = string.split (line, ':')
@@ -70,11 +71,10 @@ class Desktop (SimpleConfigFile):
inittab.write (line)
inittab.close ()
- if not os.path.isdir(instPath + '/etc/systemd/system'):
+ if not os.path.isdir(ROOT_PATH + '/etc/systemd/system'):
log.warning("there is no /etc/systemd/system directory, cannot update default.target!")
return
- default_target = instPath + '/etc/systemd/system/default.target'
+ default_target = ROOT_PATH + '/etc/systemd/system/default.target'
if os.path.islink(default_target):
os.unlink(default_target)
os.symlink('/lib/systemd/system/runlevel' + str(self.runlevel) + '.target', default_target)
-