summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
authorGabe <redhatrises@gmail.com>2014-10-03 17:27:57 -0600
committerPetr Viktorin <pviktori@dhcp-31-13.brq.redhat.com>2014-11-04 12:57:01 +0100
commit7eca640ffa3e661140843d91dc4a846d3355a242 (patch)
treef4c76b3f16e07d0efd83c9a332d7f7fbb8697744 /ipaserver/install
parent42724a4b22f9c7025254c875e9f8fcba17f8b9bf (diff)
downloadfreeipa-7eca640ffa3e661140843d91dc4a846d3355a242.tar.gz
freeipa-7eca640ffa3e661140843d91dc4a846d3355a242.tar.xz
freeipa-7eca640ffa3e661140843d91dc4a846d3355a242.zip
Remove trivial path constants from modules
https://fedorahosted.org/freeipa/ticket/4399 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/dsinstance.py9
-rw-r--r--ipaserver/install/ipa_backup.py5
-rw-r--r--ipaserver/install/ipa_restore.py3
-rw-r--r--ipaserver/install/sysupgrade.py5
-rw-r--r--ipaserver/install/upgradeinstance.py5
5 files changed, 10 insertions, 17 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index d1569697c..6fcf916ca 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -45,9 +45,6 @@ from ipapython.dn import DN
from ipaplatform import services
from ipaplatform.paths import paths
-SERVER_ROOT_64 = paths.USR_LIB_DIRSRV_64
-SERVER_ROOT_32 = paths.USR_LIB_DIRSRV
-
DS_USER = 'dirsrv'
DS_GROUP = 'dirsrv'
@@ -70,10 +67,10 @@ ALL_SCHEMA_FILES = IPA_SCHEMA_FILES + ("05rfc2247.ldif", )
def find_server_root():
- if ipautil.dir_exists(SERVER_ROOT_64):
- return SERVER_ROOT_64
+ if ipautil.dir_exists(paths.USR_LIB_DIRSRV_64):
+ return paths.USR_LIB_DIRSRV_64
else:
- return SERVER_ROOT_32
+ return paths.USR_LIB_DIRSRV
def realm_to_serverid(realm_name):
return "-".join(realm_name.split("."))
diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py
index 014b49bb6..4bee5d51f 100644
--- a/ipaserver/install/ipa_backup.py
+++ b/ipaserver/install/ipa_backup.py
@@ -63,7 +63,6 @@ EOF
--keyring /root/backup.pub --list-secret-keys
"""
-BACKUP_DIR = paths.IPA_BACKUP_DIR
def encrypt_file(filename, keyring, remove_original=True):
@@ -539,10 +538,10 @@ class Backup(admintool.AdminTool):
'''
if data_only:
- backup_dir = os.path.join(BACKUP_DIR, time.strftime('ipa-data-%Y-%m-%d-%H-%M-%S'))
+ backup_dir = os.path.join(paths.IPA_BACKUP_DIR, time.strftime('ipa-data-%Y-%m-%d-%H-%M-%S'))
filename = os.path.join(backup_dir, "ipa-data.tar")
else:
- backup_dir = os.path.join(BACKUP_DIR, time.strftime('ipa-full-%Y-%m-%d-%H-%M-%S'))
+ backup_dir = os.path.join(paths.IPA_BACKUP_DIR, time.strftime('ipa-full-%Y-%m-%d-%H-%M-%S'))
filename = os.path.join(backup_dir, "ipa-full.tar")
os.mkdir(backup_dir, 0700)
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 239de99c4..7898de0f6 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -41,7 +41,6 @@ from ipaserver.install import adtrustinstance
from ipapython import ipaldap
import ipapython.errors
from ipaplatform.tasks import tasks
-from ipaserver.install.ipa_backup import BACKUP_DIR
from ipaplatform import services
from ipaplatform.paths import paths
@@ -144,7 +143,7 @@ class Restore(admintool.AdminTool):
dirname = self.args[0]
if not os.path.isabs(dirname):
- self.backup_dir = os.path.join(BACKUP_DIR, dirname)
+ self.backup_dir = os.path.join(paths.IPA_BACKUP_DIR, dirname)
else:
self.backup_dir = dirname
diff --git a/ipaserver/install/sysupgrade.py b/ipaserver/install/sysupgrade.py
index 4ce652ca1..19e017d90 100644
--- a/ipaserver/install/sysupgrade.py
+++ b/ipaserver/install/sysupgrade.py
@@ -24,7 +24,6 @@ from ipapython import sysrestore
from ipaplatform.paths import paths
from ipapython.ipa_log_manager import *
-STATEFILE_DIR = paths.STATEFILE_DIR
STATEFILE_FILE = 'sysupgrade.state'
_sstore = None
@@ -32,7 +31,7 @@ _sstore = None
def _load_sstore():
global _sstore
if _sstore is None:
- _sstore = sysrestore.StateFile(STATEFILE_DIR, STATEFILE_FILE)
+ _sstore = sysrestore.StateFile(paths.STATEFILE_DIR, STATEFILE_FILE)
def get_upgrade_state(module, state):
_load_sstore()
@@ -51,6 +50,6 @@ def remove_upgrade_state(module, state):
def remove_upgrade_file():
try:
- os.remove(os.path.join(STATEFILE_DIR, STATEFILE_FILE))
+ os.remove(os.path.join(paths.STATEFILE_DIR, STATEFILE_FILE))
except Exception, e:
root_logger.debug('Cannot remove sysupgrade state file: %s', e)
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
index b553721eb..622f2b8cf 100644
--- a/ipaserver/install/upgradeinstance.py
+++ b/ipaserver/install/upgradeinstance.py
@@ -31,7 +31,6 @@ from ipaserver.install import schemaupdate
from ipaserver.install import ldapupdate
from ipaserver.install import service
-DSBASE = paths.ETC_DIRSRV_SLAPD_INSTANCE_TEMPLATE
DSE = 'dse.ldif'
class IPAUpgrade(service.Service):
@@ -54,8 +53,8 @@ class IPAUpgrade(service.Service):
ext += h
service.Service.__init__(self, "dirsrv")
serverid = dsinstance.realm_to_serverid(realm_name)
- self.filename = '%s/%s' % (DSBASE % serverid, DSE)
- self.savefilename = '%s/%s.ipa.%s' % (DSBASE % serverid, DSE, ext)
+ self.filename = '%s/%s' % (paths.ETC_DIRSRV_SLAPD_INSTANCE_TEMPLATE % serverid, DSE)
+ self.savefilename = '%s/%s.ipa.%s' % (paths.ETC_DIRSRV_SLAPD_INSTANCE_TEMPLATE % serverid, DSE, ext)
self.live_run = live_run
self.files = files
self.modified = False