Skip to content

Commit 14c36b7

Browse files
committed
ok
2 parents 82f6761 + 923cc33 commit 14c36b7

4 files changed

+14
-11
lines changed

cloudify/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,12 @@ def number_of_instances(self):
427427
@property
428428
def is_external(self) -> bool:
429429
"""If this is a resource that Cloudify manages or not"""
430-
return self._properties.get('use_external_resource', False)
430+
return self.properties.get('use_external_resource', False)
431431

432432
@property
433433
def resource_id(self):
434434
"""The resource's ID outside of Cloudify"""
435-
return self._properties.get('resource_id')
435+
return self.properties.get('resource_id')
436436

437437

438438
class NodeInstanceContext(EntityContext):

cloudify/tests/test_context.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,19 @@ def test_source_target_not_in_relationship(self):
323323
'deployment context.', str(cm.exception))
324324

325325
def test_node_ctx_properties(self):
326-
ctx_node = context.NodeContext(
327-
{
328-
'node': {
329-
'properties': {
330-
'use_external_resource': False,
331-
'resource_id': 'foo'
332-
}
333-
}
326+
327+
def get_node(*_, **__):
328+
return {
329+
'properties': {
330+
'use_external_resource': False,
331+
'resource_id': 'foo'
334332
}
335-
)
333+
}
334+
335+
endpoint = Mock()
336+
endpoint.get_node = get_node
337+
ctx_node = context.NodeContext(
338+
{'node_id': 'foo'}, endpoint=endpoint)
336339
self.assertFalse(ctx_node.is_external)
337340
self.assertEqual(ctx_node.resource_id, 'foo')
338341

Binary file not shown.

dev-requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)