Commit 2119fc9
committed
mgr/smb: fix ceph smb show when a cluster has not associated shares
Fix an error condition in the `ceph smb show` command. When the ceph
smb show command was run after creating a usersgroups and cluster
resource but no shares resources the following traceback was seen:
```
Error EINVAL: Traceback (most recent call last):
File "/usr/share/ceph/mgr/mgr_module.py", line 1910, in
_handle_command
return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
File "/usr/share/ceph/mgr/mgr_module.py", line 507, in call
return self.func(mgr, **kwargs)
File "/usr/share/ceph/mgr/object_format.py", line 592, in
_format_response
robj = f(*args, **kwargs)
File "/usr/share/ceph/mgr/smb/module.py", line 258, in show
resources = self._handler.matching_resources(resource_names)
File "/usr/share/ceph/mgr/smb/handler.py", line 403, in
matching_resources
return self._search_resources(matcher)
File "/usr/share/ceph/mgr/smb/handler.py", line 414, in
_search_resources
for share_id in cluster_shares[cluster_id]:
KeyError: 'smbcluster'
```
Fixes: a5cde6e
Reported-by: Anoop C S <[email protected]>
Signed-off-by: John Mulligan <[email protected]>1 parent f25386f commit 2119fc9
2 files changed
+56
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
0 commit comments