summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-10-19 09:31:16 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-10-19 14:13:09 +0200
commit596d6cceab851798de37fc02eddf64a7b2fd1d93 (patch)
treee9cdd2425216593aa259bbaf138dbaefe0542c24 /source4/scripting
parent75689effdfa2a54515fddaf823aedd07f562efc1 (diff)
downloadsamba-596d6cceab851798de37fc02eddf64a7b2fd1d93.tar.gz
samba-596d6cceab851798de37fc02eddf64a7b2fd1d93.tar.bz2
samba-596d6cceab851798de37fc02eddf64a7b2fd1d93.zip
s4-s3-upgrade Fix samba3upgrade code to cope with a missing wins.dat
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/upgrade.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
index 265bdbdd28..f9f7be1d99 100644
--- a/source4/scripting/python/samba/upgrade.py
+++ b/source4/scripting/python/samba/upgrade.py
@@ -243,6 +243,7 @@ def import_wins(samba4_winsdb, samba3_winsdb):
:param samba4_winsdb: WINS database to import to
:param samba3_winsdb: WINS database to import from
"""
+
version_id = 0
for (name, (ttl, ips, nb_flags)) in samba3_winsdb.items():
@@ -641,7 +642,15 @@ Please fix this account before attempting to upgrade again
# Import WINS database
logger.info("Importing WINS database")
- import_wins(Ldb(result.paths.winsdb), samba3.get_wins_db())
+
+ samba3_winsdb = None
+ try:
+ samba3_winsdb = samba3.get_wins_db()
+ except IOError, e:
+ logger.warn('Cannot open wins database, Ignoring: %s', str(e))
+
+ if samba3_winsdb:
+ import_wins(Ldb(result.paths.winsdb), samba3_winsdb)
# Set Account policy
logger.info("Importing Account policy")