Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Cisphyx <[email protected]>
  • Loading branch information
OCBender and Cisphyx authored Jan 3, 2025
1 parent 049645c commit 897c075
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions synapse/lib/stormlib/aha.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AhaLib(s_stormtypes.Lib):
'''},
),
'returns': {'name': 'yields', 'type': 'list',
'desc': 'Yields the result of the API call as a tuple of (svcname, (ok, info)).', }}},
'desc': 'Yields the results of the API calls as tuples of (svcname, (ok, info)).', }}},
{'name': 'callPeerGenr', 'desc': '''Call a generator API on all peers (leader and mirrors) of an AHA service and yield the responses from each.
Examples:
Expand Down Expand Up @@ -124,7 +124,7 @@ class AhaLib(s_stormtypes.Lib):
'''},
),
'returns': {'name': 'yields', 'type': 'list',
'desc': 'Yields the results of the API call as a tuple containing (svcname, (ok, info)).', }}}
'desc': 'Yields the results of the API calls as tuples containing (svcname, (ok, info)).', }}}

)
_storm_lib_path = ('aha',)
Expand Down Expand Up @@ -169,9 +169,9 @@ async def _methCallPeerApi(self, svcname, todo, timeout=None, skiprun=None):
Call an API on an AHA service.
Args:
svcname (str): The name of the AHA service to call
todo (list): The todo tuple from $lib.utils.todo()
timeout (int): Optional timeout in seconds
svcname (str): The name of the AHA service to call.
todo (list): The todo tuple from $lib.utils.todo().
timeout (int): Optional timeout in seconds.
skiprun (str): Optional run ID argument allows skipping self-enumeration.
'''
svcname = await s_stormtypes.tostr(svcname)
Expand All @@ -197,9 +197,9 @@ async def _methCallPeerGenr(self, svcname, todo, timeout=None, skiprun=None):
Call a generator API on an AHA service.
Args:
svcname (str): The name of the AHA service to call
todo (list): The todo tuple from $lib.utils.todo()
timeout (int): Optional timeout in seconds
svcname (str): The name of the AHA service to call.
todo (list): The todo tuple from $lib.utils.todo().
timeout (int): Optional timeout in seconds.
skiprun (str): Optional run ID argument allows skipping self-enumeration.
'''
svcname = await s_stormtypes.tostr(svcname)
Expand Down Expand Up @@ -676,7 +676,7 @@ async def _methPoolSvcDel(self, svcname):
'''),
'cmdargs': (
('--timeout', {'help': 'The number of seconds to wait for the mirrors to sync.',
'default': 10, 'type': 'int', 'action': 'store'}),
'default': 10, 'type': 'int'}),
('--wait', {'help': 'Whether to wait for the mirrors to sync.',
'action': 'store_true'}),
),
Expand Down Expand Up @@ -817,8 +817,7 @@ async def _methPoolSvcDel(self, svcname):
continue
}
$members = ()
$members.append($primary_member)
$members = ([$primary_member])
for ($mname, $msvc) in $member_servers {
if ($mname != $vsvc_hostname) {
$msvc_info = $msvc.svcinfo
Expand Down

0 comments on commit 897c075

Please sign in to comment.