[SCM] Samba Shared Repository - branch master updated
Amitay Isaacs
amitay at samba.org
Mon Jan 23 19:33:02 MST 2012
The branch, master has been updated
via 1f0298d python: Change except: statement to except Exception:
via be29202 autobuild.py: Catch only true exceptions in except statement
from 869fd8e Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 1f0298dd1b1a939cb215e7b474178b217f8347f4
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jan 24 11:54:54 2012 +1100
python: Change except: statement to except Exception:
This way we only catch true exceptions and keyboard interrupts
are not caught here.
Autobuild-User: Amitay Isaacs <amitay at samba.org>
Autobuild-Date: Tue Jan 24 03:32:40 CET 2012 on sn-devel-104
commit be292021f47eeaa1364bedb2dc9232b60c404fce
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jan 24 11:43:46 2012 +1100
autobuild.py: Catch only true exceptions in except statement
sys.exit(0) raises systemExit which is caught in empty except:
statement. This can change the exit status if except: condition is
supposed to exit with different status value.
-----------------------------------------------------------------------
Summary of changes:
script/autobuild.py | 6 +++---
source4/dsdb/tests/python/dirsync.py | 2 +-
source4/scripting/bin/upgradeprovision | 8 ++++----
source4/scripting/devel/repl_cleartext_pwd.py | 6 +++---
source4/scripting/python/samba/join.py | 2 +-
source4/scripting/python/samba/netcmd/dbcheck.py | 2 +-
source4/scripting/python/samba/netcmd/domain.py | 2 +-
.../scripting/python/samba/provision/sambadns.py | 4 ++--
.../scripting/python/samba/tests/dcerpc/testrpc.py | 2 +-
source4/setup/provision | 2 +-
10 files changed, 18 insertions(+), 18 deletions(-)
Changeset truncated at 500 lines:
diff --git a/script/autobuild.py b/script/autobuild.py
index d6ad082..8ddd4b3 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -493,7 +493,7 @@ while True:
run_cmd("rm -rf %s" % test_master)
cleanup_list.append(test_master)
run_cmd("git clone --shared %s %s" % (gitroot, test_master), show=True, dir=gitroot)
- except:
+ except Exception:
cleanup()
raise
@@ -503,7 +503,7 @@ while True:
rebase_tree(options.rebase)
elif options.rebase_master:
rebase_tree(samba_master)
- except:
+ except Exception:
cleanup_list.append(gitroot + "/autobuild.pid")
cleanup()
email_failure(-1, 'rebase', 'rebase', 'rebase', 'rebase on master failed')
@@ -515,7 +515,7 @@ while True:
if status != 0 or errstr != "retry":
break
cleanup()
- except:
+ except Exception:
cleanup()
raise
diff --git a/source4/dsdb/tests/python/dirsync.py b/source4/dsdb/tests/python/dirsync.py
index 6da9003..64b847f 100755
--- a/source4/dsdb/tests/python/dirsync.py
+++ b/source4/dsdb/tests/python/dirsync.py
@@ -136,7 +136,7 @@ class SimpleDirsyncTests(DirsyncBaseTests):
self.sd_utils.modify_sd_on_dn(self.base_dn, self.desc_sddl)
try:
self.ldb_admin.deletegroup("testgroup")
- except:
+ except Exception:
pass
#def test_dirsync_errors(self):
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index 738d6be..aec0774 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -1488,14 +1488,14 @@ def copyxattrs(dir, refdir):
samba.xattr_native.wrap_setxattr(tgt,
xattr.XATTR_NTACL_NAME,
attribute)
- except:
+ except Exception:
noxattr = 1
attribute = samba.xattr_native.wrap_getxattr(ref,
"system.posix_acl_access")
samba.xattr_native.wrap_setxattr(tgt,
"system.posix_acl_access",
attribute)
- except:
+ except Exception:
continue
for name in dirs:
subdir=root[len(dir):]
@@ -1511,7 +1511,7 @@ def copyxattrs(dir, refdir):
samba.xattr_native.wrap_setxattr(tgt,
xattr.XATTR_NTACL_NAME,
attribute)
- except:
+ except Exception:
noxattr = 1
attribute = samba.xattr_native.wrap_getxattr(ref,
"system.posix_acl_access")
@@ -1519,7 +1519,7 @@ def copyxattrs(dir, refdir):
"system.posix_acl_access",
attribute)
- except:
+ except Exception:
continue
diff --git a/source4/scripting/devel/repl_cleartext_pwd.py b/source4/scripting/devel/repl_cleartext_pwd.py
index 840d281..5eebc86 100755
--- a/source4/scripting/devel/repl_cleartext_pwd.py
+++ b/source4/scripting/devel/repl_cleartext_pwd.py
@@ -101,7 +101,7 @@ if __name__ == "__main__":
if len(args) >= 7:
try:
attid = int(args[4], 16)
- except:
+ except Exception:
attid = int(args[4])
attname = args[5]
attmode = args[6]
@@ -145,7 +145,7 @@ if __name__ == "__main__":
assert store_dn == dn
#print "%s" % ndr_print(store_hwm)
#print "%s" % ndr_print(store_utdv)
- except:
+ except Exception:
store_dn = dn
store_hwm = drsuapi.DsReplicaHighWaterMark()
store_hwm.tmp_highest_usn = 0
@@ -325,7 +325,7 @@ if __name__ == "__main__":
cleartext_unicode = unicode(cleartext_utf16, 'utf-16-le')
cleartext_utf8 = cleartext_unicode.encode('utf-8')
gls.add_attr(obj.identifier.dn, clear_utf8_name, [cleartext_utf8])
- except:
+ except Exception:
pass
if attvals is not None:
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 818e0ce..dc2ceef 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -683,7 +683,7 @@ class dc_join(object):
ctx.destination_dsa_guid = destination_dsa_guid
print "Committing SAM database"
- except:
+ except Exception:
ctx.local_samdb.transaction_cancel()
raise
else:
diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py
index bd250eb..875b059 100644
--- a/source4/scripting/python/samba/netcmd/dbcheck.py
+++ b/source4/scripting/python/samba/netcmd/dbcheck.py
@@ -112,7 +112,7 @@ class cmd_dbcheck(Command):
else:
error_count = chk.check_database(DN=DN, scope=search_scope,
controls=controls, attrs=attrs)
- except:
+ except Exception:
if started_transaction:
samdb.transaction_cancel()
raise
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index 6c2ebfa..1e26850 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -855,7 +855,7 @@ class cmd_domain_samba3upgrade(Command):
samba.ntacls.setntacl(lp, tmpfile.name,
"O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native")
eadb = False
- except:
+ except Exception:
# FIXME: Don't catch all exceptions here
logger.info("You are not root or your system do not support xattr, using tdb backend for attributes. "
"If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
diff --git a/source4/scripting/python/samba/provision/sambadns.py b/source4/scripting/python/samba/provision/sambadns.py
index db98f13..4805294 100644
--- a/source4/scripting/python/samba/provision/sambadns.py
+++ b/source4/scripting/python/samba/provision/sambadns.py
@@ -719,7 +719,7 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
"DOMAINSID" : str(domainsid),
"DESCRIPTOR" : descr})
setup_add_ldif(dom_ldb, setup_path("provision_basedn_options.ldif"), None)
- except:
+ except Exception:
logger.error("Failed to setup database for BIND, AD based DNS cannot be used")
raise
del partfile[domaindn]
@@ -754,7 +754,7 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
tdb_copy(logger,
os.path.join(private_dir, pfile),
os.path.join(dns_dir, pfile))
- except:
+ except Exception:
logger.error("Failed to setup database for BIND, AD based DNS cannot be used")
raise
diff --git a/source4/scripting/python/samba/tests/dcerpc/testrpc.py b/source4/scripting/python/samba/tests/dcerpc/testrpc.py
index 44fed72..9c25419 100644
--- a/source4/scripting/python/samba/tests/dcerpc/testrpc.py
+++ b/source4/scripting/python/samba/tests/dcerpc/testrpc.py
@@ -61,7 +61,7 @@ class RpcTests(object):
print "ERROR: Failed to instantiate %s.%s" % (typename, n)
self.errcount += 1
continue
- except:
+ except Exception:
print "ERROR: Failed to instantiate %s.%s" % (typename, n)
self.errcount += 1
continue
diff --git a/source4/setup/provision b/source4/setup/provision
index cea8823..be52854 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -230,7 +230,7 @@ elif opts.use_xattrs == "auto" and not lp.get("posix:eadb"):
samba.ntacls.setntacl(lp, file.name,
"O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native")
eadb = False
- except:
+ except Exception:
logger.info("You are not root or your system do not support xattr, using tdb backend for attributes. "
"If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.")
file.close()
--
Samba Shared Repository
More information about the samba-cvs
mailing list