summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-03-30 10:27:23 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2011-03-30 10:27:23 +0200
commit11366b8a1a156fa645c4f24d4c3bf939e064d4c9 (patch)
tree38a0f65a7f3640dcfd0e39ad531717fc753634eb
parentb6a34d013bd81c336312c09f55c417da1163b3f1 (diff)
downloadaurweb-11366b8a1a156fa645c4f24d4c3bf939e064d4c9.tar.xz
gendummydata.py: Do not touch output file until we need it.
Ensures there's no leftover (empty) file if something during initialization fails. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rwxr-xr-xsupport/schema/gendummydata.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py
index cdf365b..7b1d0cf 100755
--- a/support/schema/gendummydata.py
+++ b/support/schema/gendummydata.py
@@ -50,11 +50,6 @@ if len(sys.argv) != 2:
sys.stderr.write("Missing output filename argument");
raise SystemExit
-# Just let python throw the errors if any happen
-#
-out = open(sys.argv[1], "w")
-out.write("BEGIN;\n")
-
# make sure the seed file exists
#
if not os.path.exists(SEED_FILE):
@@ -177,6 +172,11 @@ trustedusers = []
has_devs = 0
has_tus = 0
+# Just let python throw the errors if any happen
+#
+out = open(sys.argv[1], "w")
+out.write("BEGIN;\n")
+
# Begin by creating the User statements
#
if DBUG: print "Creating SQL statements for users.",