summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Reports/importscript.py
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-08-07 13:37:33 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-08-07 13:37:33 -0500
commit5b3ffd488a8b5f727a531a3b7c3ca419bb53d04e (patch)
treee816129405d12aad7069b7450b9121ed201ea23b /src/lib/Bcfg2/Server/Reports/importscript.py
parentcb928a1f548fe1e65933ecbb62220295802f160b (diff)
downloadbcfg2-5b3ffd488a8b5f727a531a3b7c3ca419bb53d04e.tar.gz
bcfg2-5b3ffd488a8b5f727a531a3b7c3ca419bb53d04e.tar.bz2
bcfg2-5b3ffd488a8b5f727a531a3b7c3ca419bb53d04e.zip
Merge reporting configuration with main server configuration
Admin/Syncdb: Use SchemaUpdater Move the schema update routines from reports to Bcfg2.Server Move Reports.settings into Bcfg2.settings
Diffstat (limited to 'src/lib/Bcfg2/Server/Reports/importscript.py')
-rwxr-xr-xsrc/lib/Bcfg2/Server/Reports/importscript.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/importscript.py b/src/lib/Bcfg2/Server/Reports/importscript.py
index 14f2bb1f9..289970244 100755
--- a/src/lib/Bcfg2/Server/Reports/importscript.py
+++ b/src/lib/Bcfg2/Server/Reports/importscript.py
@@ -9,13 +9,13 @@ import os
import sys
import traceback
try:
- import Bcfg2.Server.Reports.settings
+ import Bcfg2.settings
except Exception:
e = sys.exc_info()[1]
sys.stderr.write("Failed to load configuration settings. %s\n" % e)
sys.exit(1)
-project_directory = os.path.dirname(Bcfg2.Server.Reports.settings.__file__)
+project_directory = os.path.dirname(Bcfg2.settings.__file__)
project_name = os.path.basename(project_directory)
sys.path.append(os.path.join(project_directory, '..'))
project_module = __import__(project_name, '', '', [''])
@@ -30,7 +30,6 @@ from datetime import datetime
from time import strptime
from django.db import connection, transaction
from Bcfg2.Server.Plugins.Metadata import ClientMetadata
-from Bcfg2.Server.Reports.Updater import update_database, UpdaterError
import logging
import Bcfg2.Logger
import platform
@@ -321,6 +320,9 @@ if __name__ == '__main__':
encoding = 'UTF-8'
q = '-O3' in sys.argv
+
+ # don't load this at the top. causes a circular import error
+ from Bcfg2.Server.SchemaUpdater import update_database, UpdaterError
# Be sure the database is ready for new schema
try:
update_database()