Commit 621ff841 authored by Romain Courteaud's avatar Romain Courteaud

slapos_slap_tool: fixup project_reference discovery

parent f8b3311a
......@@ -1019,16 +1019,18 @@ class SlapTool(BaseTool):
elif 'computer_guid' in filter_kw:
computer_list = portal.portal_catalog(
portal_type=['Compute Node', 'Remote Node', 'Instance Node'],
reference=filter_kw['computer_guid'],
limit=2
)
if len(computer_list == 1):
if len(computer_list) == 1:
kw['project_reference'] = computer_list[0].getFollowUpReference()
elif 'network_guid' in filter_kw:
network_list = portal.portal_catalog(
portal_type='Computer Network',
reference=filter_kw['network_guid'],
limit=2
)
if len(network_list == 1):
if len(network_list) == 1:
kw['project_reference'] = network_list[0].getFollowUpReference()
key = '_'.join([requester.getRelativeUrl(), partition_reference])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment