samba-tool: Ensure that samba-tool processes --name=not-existing does not error
authorAndrew Bartlett <abartlet@samba.org>
Fri, 24 Mar 2017 00:07:06 +0000 (13:07 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Mar 2017 07:23:11 +0000 (09:23 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12705

python/samba/netcmd/processes.py
selftest/knownfail

index b25a2e453ec4376e2a05afa94bec50bb9eb350ba..c8000b7e49e53c11eeb9c76fb82601bdfde84513 100644 (file)
@@ -60,7 +60,11 @@ class cmd_processes(Command):
         msg_ctx = Messaging()
 
         if name is not None:
-            ids = msg_ctx.irpc_servers_byname(name)
+            try:
+                ids = msg_ctx.irpc_servers_byname(name)
+            except KeyError:
+                ids = []
+
             for server_id in ids:
                 self.outf.write("%d\n" % server_id.pid)
         elif pid is not None:
index 1657ff3ff221dbec6734f78f41b2fff5d86ce2ed..b25038064c3c458811d46f06f4e0e473ec8abaad 100644 (file)
 ^samba3.smb2.credits.skipped_mid.*
 ^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dangling_multi_valued_dbcheck
 ^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dangling_multi_valued_check_missing
-^samba.tests.samba_tool.processes.samba.tests.samba_tool.processes.ProcessCmdTestCase.test_unknown_name\(ad_dc_ntvfs:local\)