diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-03-24 13:07:06 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-03-28 09:23:11 +0200 |
commit | a47a8e41bd3acc20d40ba78449d89775bcdd73ed (patch) | |
tree | c92d0b3372ac2925fd8159d50ccfe34f514c90f1 /python | |
parent | f21c17c6d0bfa304c54d80aaceb91aad1a3a6bb1 (diff) | |
download | samba-a47a8e41bd3acc20d40ba78449d89775bcdd73ed.tar.gz |
samba-tool: Ensure that samba-tool processes --name=not-existing does not error
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
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/netcmd/processes.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/samba/netcmd/processes.py b/python/samba/netcmd/processes.py index b25a2e453ec..c8000b7e49e 100644 --- a/python/samba/netcmd/processes.py +++ b/python/samba/netcmd/processes.py @@ -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: |