1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

samba_tool: make exception handling statements py2/py3 compatible

Fix some missed conversions of
        except Exception, e:
to
        except Exception as e:

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Noel Power 2018-05-04 11:31:33 +01:00 committed by Andrew Bartlett
parent 7399da0b44
commit 9410cea310

View File

@ -298,7 +298,7 @@ Example3 shows how to create a new computer in the OrgUnit organizational unit.
samdb, hostname, dns_conn,
change_owner_sd, samdb.host_dns_name(),
ip_address_list, self.get_logger())
except Exception, e:
except Exception as e:
raise CommandError("Failed to create computer '%s': " %
computername, e)
@ -394,7 +394,7 @@ sudo is used so a computer may run the command as root.
remove_dns_references(
samdb, self.get_logger(), computer_dns_host_name,
ignore_no_name=True)
except Exception, e:
except Exception as e:
raise CommandError('Failed to remove computer "%s"' %
samaccountname, e)
self.outf.write("Deleted computer %s\n" % computername)
@ -569,7 +569,7 @@ class cmd_computer_move(Command):
new_computer_dn.add_base(full_new_ou_dn)
try:
samdb.rename(computer_dn, new_computer_dn)
except Exception, e:
except Exception as e:
raise CommandError('Failed to move computer "%s"' % computername, e)
self.outf.write('Moved computer "%s" to "%s"\n' %
(computername, new_ou_dn))