Commit 6ae33326 authored by Romain Courteaud's avatar Romain Courteaud

slapos_slap_tool: fixup project_reference discovery

parent 2ce4c73d
...@@ -1019,16 +1019,18 @@ class SlapTool(BaseTool): ...@@ -1019,16 +1019,18 @@ class SlapTool(BaseTool):
elif 'computer_guid' in filter_kw: elif 'computer_guid' in filter_kw:
computer_list = portal.portal_catalog( computer_list = portal.portal_catalog(
portal_type=['Compute Node', 'Remote Node', 'Instance Node'], portal_type=['Compute Node', 'Remote Node', 'Instance Node'],
reference=filter_kw['computer_guid'],
limit=2 limit=2
) )
if len(computer_list == 1): if len(computer_list) == 1:
kw['project_reference'] = computer_list[0].getFollowUpReference() kw['project_reference'] = computer_list[0].getFollowUpReference()
elif 'network_guid' in filter_kw: elif 'network_guid' in filter_kw:
network_list = portal.portal_catalog( network_list = portal.portal_catalog(
portal_type='Computer Network', portal_type='Computer Network',
reference=filter_kw['network_guid'],
limit=2 limit=2
) )
if len(network_list == 1): if len(network_list) == 1:
kw['project_reference'] = network_list[0].getFollowUpReference() kw['project_reference'] = network_list[0].getFollowUpReference()
key = '_'.join([requester.getRelativeUrl(), partition_reference]) 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