Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthmanT committed Feb 1, 2023
2 parents 82f6761 + 923cc33 commit 14c36b7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cloudify/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@ def number_of_instances(self):
@property
def is_external(self) -> bool:
"""If this is a resource that Cloudify manages or not"""
return self._properties.get('use_external_resource', False)
return self.properties.get('use_external_resource', False)

@property
def resource_id(self):
"""The resource's ID outside of Cloudify"""
return self._properties.get('resource_id')
return self.properties.get('resource_id')


class NodeInstanceContext(EntityContext):
Expand Down
21 changes: 12 additions & 9 deletions cloudify/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,19 @@ def test_source_target_not_in_relationship(self):
'deployment context.', str(cm.exception))

def test_node_ctx_properties(self):
ctx_node = context.NodeContext(
{
'node': {
'properties': {
'use_external_resource': False,
'resource_id': 'foo'
}
}

def get_node(*_, **__):
return {
'properties': {
'use_external_resource': False,
'resource_id': 'foo'
}
)
}

endpoint = Mock()
endpoint.get_node = get_node
ctx_node = context.NodeContext(
{'node_id': 'foo'}, endpoint=endpoint)
self.assertFalse(ctx_node.is_external)
self.assertEqual(ctx_node.resource_id, 'foo')

Expand Down
Binary file not shown.
Empty file added dev-requirements.txt
Empty file.

0 comments on commit 14c36b7

Please sign in to comment.