summaryrefslogtreecommitdiff
path: root/python/samba/netcmd/fsmo.py
AgeCommit message (Collapse)AuthorFilesLines
2019-05-30samba-tool: add 'import samba.drs_utils' to fsmo.pyBjörn Baumbach1-0/+1
On some systems we're seeing this: ERROR(<type 'exceptions.AttributeError'>): uncaught exception - 'module' object has no attribute 'drs_utils' File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 185, in _run return self.run(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/samba/netcmd/fsmo.py", line 533, in run transfer_dns_role(self.outf, sambaopts, credopts, role, samdb) File "/usr/lib/python2.7/dist-packages/samba/netcmd/fsmo.py", line 136, in transfer_dns_role except samba.drs_utils.drsException as e: E.g. it happens on debian stretch (9.9) with python 2.7.13 (on 4.10.4) While it doesn't happen on ubuntu 18.04 with python 2.7.15rc1 or with python 3.6.7. There were also some reports on the mailing lists, see: https://lists.samba.org/archive/samba-technical/2019-May/133624.html BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Björn Baumbach <bbaumbach@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu May 30 08:27:24 UTC 2019 on sn-devel-184
2019-05-30samba-tool: use only one LDAP modify for dns partition fsmo role transferStefan Metzmacher1-16/+6
We should not risk that we end with no role owner. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-30samba-tool: fix replication after dns partition fsmo role transferStefan Metzmacher1-1/+3
The new role owner need to replicate from the old role owner. Before we told the old role owner to replicate from itself. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-06PEP8: fix E128: continuation line under-indented for visual indentJoe Guo1-2/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Sep 6 15:50:17 CEST 2018 on sn-devel-144
2018-08-24PEP8: fix E712: comparison to False should be 'if cond is False:' or 'if not ↵Joe Guo1-2/+2
cond:' Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E303: too many blank lines (2)Joe Guo1-1/+0
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo1-0/+4
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E265: block comment should start with '# 'Joe Guo1-4/+4
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E225: missing whitespace around operatorJoe Guo1-8/+8
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E128: continuation line under-indented for visual indentJoe Guo1-5/+5
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E124: closing bracket does not match visual indentationJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E123: closing bracket does not match indentation of opening ↵Joe Guo1-7/+7
bracket's line Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-30python: Bulk conversion callers of ldb.Dn second paramNoel Power1-3/+3
Convert second param passed to ldb.Dn to be unicode so py2 & py3 code will work Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-02-28samba-tool: convert 'except X, (tuple)' to 'except X as e'Noel Power1-8/+16
In addition to converting the except line another line is also added for each except to extract the tuple contents. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-02-15samba-tool: convert 'except X, e' to 'except X as e' for all XDouglas Bagnall1-3/+3
This is needed for Python 3 and is compatible with python 2.6 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-11-04samba_tool/fsmo: Allocate RID Set when seizing RID managerGarming Sam1-2/+27
Seizing the role without allocating a RID set for itself is likely prone to cause issues. Pair-programmed-with: Clive Ferreira <cliveferreira@catalyst.net.nz> Signed-off-by: Clive Ferreira <cliveferreira@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=9954 Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Fri Nov 4 08:37:05 CET 2016 on sn-devel-144
2016-06-16samba-tool: Improve fsmo handlingAndrew Bartlett1-39/+41
This makes a clear seperation between data and display variables and improves the tests. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-01samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo rolesRowland Penny1-98/+135
samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles Signed-off-by: Rowland Penny <rpenny@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-12-06samba-tool: fsmo.py throws an uncaught exception if noRowland Penny1-1/+2
fSMORoleOwner attribute This will fix bug 11613 where a user got the uncaught exception when trying to seize an FSMO role that didn't have the required attribute. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11613 Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Sun Dec 6 00:33:10 CET 2015 on sn-devel-104
2015-06-18samba-tool: make 'samba-tool fsmo *' aware of all 7 fsmo rolesRowland Penny1-78/+268
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10734 Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Jose A. Rivera <jarrpa@samba.org> Autobuild-User(master): José A. Rivera <jarrpa@samba.org> Autobuild-Date(master): Thu Jun 18 10:24:48 CEST 2015 on sn-devel-104
2015-03-16s4.2/fsmo.py: fixed fsmo transfer exceptionSteve Howells1-1/+0
In transfer_role() there is an duplicate call to samdb.modify() inside the if statement where the type of role is being determined (specifically for the naming fsmo). This call is unnecessary as after the if statement their is a correct call, with a try/catch block, used by all fsmo transfers that will handle errors - such as the DC with the fsmo role being offline. The call to samdb.modify() inside the if statement for naming fsmo has been removed. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10924 Signed-off-by: Steve Howells <steve.howells@moscowfirst.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-09-23python-samba-tool fsmo: Do not give an error on a successful role transferAndrew Bartlett1-7/+7
Bug: https://bugzilla.samba.org/show_bug.cgi?id=9461 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Sep 23 12:00:24 CEST 2013 on sn-devel-104
2013-03-02Move python modules from source4/scripting/python/ to python/.Jelmer Vernooij1-0/+277
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 03:57:34 CET 2013 on sn-devel-104