aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStevan Radaković <stevan.radakovic@linaro.org>2013-01-28 16:52:53 +0100
committerStevan Radaković <stevan.radakovic@linaro.org>2013-01-28 16:52:53 +0100
commit97059be1cdb0368fade3155a0dda05403d7c7a4b (patch)
treebfb6ac4466dd7d99d287e939c56c053d40f3b5d1 /scripts
parent35b56419405b89d128a071437549d04e6ed4bb8b (diff)
Move tempfile init outside of try block.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rhodecode-setup2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/rhodecode-setup b/scripts/rhodecode-setup
index f348d6b..eadf49c 100755
--- a/scripts/rhodecode-setup
+++ b/scripts/rhodecode-setup
@@ -549,8 +549,8 @@ def backup_postgres_db(home_dir, db_name, postgres_usr="postgres"):
:type str
"""
date = datetime.date.today()
+ tempfile = tempfile.NamedTemporaryFile()
try:
- tempfile = tempfile.NamedTemporaryFile()
db_filename = "%s.%s" % (DB_BACKUP_FILENAME, date.strftime("%Y.%m.%d"))
cmd_args = ["-u", postgres_usr, "pg_dump", db_name, "-f",
tempfile.name]