samba_tool: make exception handling statements py2/py3 compatible
authorNoel Power <noel.power@suse.com>
Fri, 4 May 2018 10:31:33 +0000 (11:31 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 19:38:16 +0000 (21:38 +0200)
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>
python/samba/netcmd/computer.py

index 3b130b1fa256b149178352bdd7db788951069d4f..9ca8904a70e405a01d3432ffa1a22b6686804c8c 100644 (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))