Skip to content

Commit 388a68e

Browse files
authored
Merge pull request #317 from cloudify-incubator/1.26.0-build
1.26.0 build
2 parents 1fcbc37 + c106590 commit 388a68e

36 files changed

+2506
-2930
lines changed

CHANGELOG.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
1.26.0:
2+
- RND-555-deprecate-utils-types:
3+
- load_from_config relationship
4+
- cloudify.rest.BunchRequests node type
5+
- cloudify.rest.Requests node type
6+
- cloudify.terminal.raw node type
7+
- cloudify.keys.nodes.RSAKey node type
8+
- configuration_loader node type
19
1.25.17: Improve logging message.
210
1.25.16: CYBL-2002 - Add option to update secrets if they exist but not by default
311
1.25.15: CYBL-2016 Fix runtime_properties update at concurrent reservations.
@@ -73,7 +81,7 @@ v1.21.0:
7381
- rest support run action as hook
7482

7583
v1.20.0:
76-
- ssh_key add use_secrets_if_exist property to cloudify.keys.nodes.RSAKey node.
84+
- ssh_key add use_secrets_if_exist property to cloudify.nodes.keys.RSAKey node.
7785

7886
v1.19.0:
7987
- hooks add hooks events filtering plugin

cloudify_cloudinit/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '1.25.17'
1+
version = '1.26.0'

cloudify_configuration/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ It will also be used as a target in relationships with nodes consuming the confi
3232
3333
```yaml
3434
configuration:
35-
type: configuration_loader
35+
type: cloudify.nodes.ConfigurationLoader
3636
properties:
3737
parameters_json: { get_input: parameters_json }
3838
```
@@ -109,7 +109,7 @@ properties with the values relevant as specified in the `params_list`
109109
deep_error_check: true
110110
params: { get_attribute: [SELF, params] }
111111
relationships:
112-
- type: load_from_config
112+
- type: cloudify.relationships.load_from_config
113113
target: configuration
114114
```
115115

@@ -201,7 +201,7 @@ Configuration loader holds the entire configuration in it’s runtime properties
201201

202202
**Relationships:**
203203

204-
* `load_from_config`: Derived from `cloudify.relationships.depends_on` and must be used with target node only, e.g.: `cloudify.terminal.raw`.
204+
* `cloudify.relationships.load_from_config`: Derived from `cloudify.relationships.depends_on` and must be used with target node only, e.g.: `cloudify.nodes.terminal.Raw`.
205205
Update `params` in depended node by filter in `params_list` and is called before `configuration` action in node.
206206

207207
**Examples:**

cloudify_configuration/examples/simple.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ tosca_definitions_version: cloudify_dsl_1_3
22

33
imports:
44
- http://www.getcloudify.org/spec/cloudify/5.0.0/types.yaml
5-
- http://www.getcloudify.org/spec/utilities-plugin/1.18.0/plugin.yaml
5+
- plugin:cloudify-utilities-plugin
66

77
inputs:
88

@@ -44,7 +44,7 @@ inputs:
4444
node_types:
4545

4646
terminal:
47-
derived_from: cloudify.terminal.raw
47+
derived_from: cloudify.nodes.terminal.Raw
4848
properties:
4949
params_list:
5050
default: {}
@@ -56,7 +56,7 @@ node_types:
5656
node_templates:
5757

5858
configuration:
59-
type: configuration_loader
59+
type: cloudify.nodes.ConfigurationLoader
6060
properties:
6161
parameters_json: { get_input: parameters_json }
6262

cloudify_configuration/tasks.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def _handle_parameters(parameters):
5555

5656
def load_configuration(parameters=None, merge_dicts=False, **kwargs):
5757

58+
if 'configuration_loader' in ctx.node.type_hierarchy:
59+
ctx.logger.error(
60+
'The node type configuration_loader is deprecated, '
61+
'please update your blueprint to use '
62+
'cloudify.nodes.ConfigurationLoader.')
63+
5864
parameters = parameters or \
5965
ctx.node.properties.get('parameters_json', {})
6066

@@ -73,6 +79,13 @@ def load_configuration(parameters=None, merge_dicts=False, **kwargs):
7379

7480
def load_configuration_to_runtime_properties(source_config=None, **kwargs):
7581

82+
if 'configuration_loader' in ctx.source.node.type_hierarchy or \
83+
'configuration_loader' in ctx.target.node.type_hierarchy:
84+
ctx.logger.error(
85+
'The node type configuration_loader is deprecated, '
86+
'please update your blueprint to use '
87+
'cloudify.nodes.ConfigurationLoader.')
88+
7689
source_config = source_config or \
7790
ctx.target.instance.runtime_properties.get('params', {})
7891

cloudify_configuration/tests/test_tasks.py

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,38 @@
1515
from mock import MagicMock, patch
1616

1717
from cloudify.state import current_ctx
18-
from cloudify.mocks import MockCloudifyContext
18+
from cloudify.mocks import MockNodeContext, MockCloudifyContext
1919

2020
from .. import tasks
2121

2222

23+
class MockNodeCtx(MockNodeContext):
24+
25+
def __init__(self, *_, **__):
26+
super().__init__(*_, **__)
27+
28+
@property
29+
def type_hierarchy(self):
30+
return [self._type, 'cloudify.nodes.Root']
31+
32+
33+
class MockCtx(MockCloudifyContext):
34+
def __init__(self, *_, **kwargs):
35+
super().__init__(*_, **kwargs)
36+
node_name = kwargs.get('node_name')
37+
properties = kwargs.get('properties')
38+
node_type = kwargs.get('node_type')
39+
self._node = MockNodeCtx(node_name, properties, node_type)
40+
41+
2342
class TestTasks(unittest.TestCase):
2443

2544
def tearDown(self):
2645
current_ctx.clear()
2746
super(TestTasks, self).tearDown()
2847

2948
def test_load_configuration(self):
30-
_ctx = MockCloudifyContext(
49+
_ctx = MockCtx(
3150
'node_name',
3251
properties={},
3352
runtime_properties={}
@@ -41,7 +60,7 @@ def test_load_configuration(self):
4160
})
4261

4362
def test_load_json_configuration(self):
44-
_ctx = MockCloudifyContext(
63+
_ctx = MockCtx(
4564
'node_name',
4665
properties={},
4766
runtime_properties={}
@@ -55,7 +74,7 @@ def test_load_json_configuration(self):
5574
})
5675

5776
def test_load_configuration_can_merge_dicts(self):
58-
_ctx = MockCloudifyContext(
77+
_ctx = MockCtx(
5978
'node_name',
6079
properties={},
6180
runtime_properties={
@@ -92,20 +111,20 @@ def test_load_configuration_can_merge_dicts(self):
92111
})
93112

94113
def test_load_configuration_to_runtime_properties(self):
95-
_source_ctx = MockCloudifyContext(
114+
_source_ctx = MockCtx(
96115
'source_name',
97116
properties={'params_list': ['a', 'c'],
98117
'params': {'a': 'e', 'c': 'g'}},
99118
runtime_properties={
100119
'params': {'a': 'n', 'c': 'g'}
101120
}
102121
)
103-
_target_ctx = MockCloudifyContext(
122+
_target_ctx = MockCtx(
104123
'source_name',
105124
properties={},
106125
runtime_properties={}
107126
)
108-
_ctx = MockCloudifyContext(
127+
_ctx = MockCtx(
109128
deployment_id='relationship_name',
110129
properties={},
111130
source=_source_ctx,

cloudify_rest/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Features:
1515
- configurable recoverable errors
1616
- context sensitive "response expectation"
1717

18-
Action inputs in `cloudify.rest.Requests`:
18+
Action inputs in `cloudify.nodes.rest.Requests`:
1919
* `params`: Template parameters. Default is empty dictionary.
2020
* `params_attributes`: dictionary with list based path to values in
2121
`runtime_prioperties`.
@@ -27,10 +27,10 @@ Action inputs in `cloudify.rest.Requests`:
2727
* `remove_calls`: Remove calls list from results. Default: save calls in
2828
runtime properties.
2929

30-
Action inputs in `cloudify.rest.BunchRequests` is list of inputs from
31-
`cloudify.rest.Requests`.
30+
Action inputs in `cloudify.nodes.rest.BunchRequests` is list of inputs from
31+
`cloudify.nodes.rest.Requests`.
3232

33-
Node properties for `cloudify.rest.Requests` and `cloudify.rest.BunchRequests`:
33+
Node properties for `cloudify.nodes.rest.Requests` and `cloudify.nodes.rest.BunchRequests`:
3434
* `hosts`: list of hosts name or IP addresses of Rest Servers
3535
* `host`: host name or IP addresses of Rest Servers if list of hosts is not
3636
needed single host can be provided by this property. NOTE: the 'hosts'
@@ -76,7 +76,7 @@ hooks:
7676
Supported parameters:
7777
* `inputs`: passed from cloudify hooks (or first param hooks)
7878
* `logger_file`: duplicate logger output to separate file
79-
* `properties`: connection properties(same as properties in `cloudify.rest.Requests`)
79+
* `properties`: connection properties(same as properties in `cloudify.nodes.rest.Requests`)
8080
* `template_file`: absolute path to template file
8181
* `params`: Template parameters, additionally providided `__inputs__` from hooks.
8282
Default is empty dictionary.
@@ -93,7 +93,7 @@ Supported parameters:
9393

9494
```yaml
9595
user:
96-
type: cloudify.rest.Requests
96+
type: cloudify.nodes.rest.Requests
9797
properties:
9898
hosts:
9999
- { get_input: rest_endpoint }
@@ -111,7 +111,7 @@ Supported parameters:
111111

112112
```yaml
113113
user:
114-
cloudify.rest.BunchRequests
114+
type: cloudify.nodes.rest.BunchRequests
115115
properties:
116116
# hosts:
117117
# - { get_input: rest_endpoint }
@@ -279,5 +279,5 @@ Real life example how F5 BigIP can be provisioned with REST API
279279
blueprint: [example-5-blueprint.yaml](examples/example-5-blueprint.yaml)
280280

281281
Example for get users list, create new user based on first result and than
282-
remove new created user. Have used `cloudify.rest.BunchRequests` with
282+
remove new created user. Have used `cloudify.nodes.rest.BunchRequests` with
283283
`params_attributes`.

cloudify_rest/examples/example-1-blueprint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ inputs:
172172
node_templates:
173173

174174
user10-all-properties:
175-
type: cloudify.rest.Requests
175+
type: cloudify.nodes.rest.Requests
176176
properties:
177177
hosts: [{ get_input: rest_endpoint }]
178178
port: 443
@@ -185,7 +185,7 @@ node_templates:
185185
template_file: templates/get-user-all-properties-template.yaml
186186

187187
user10-some-properties:
188-
type: cloudify.rest.Requests
188+
type: cloudify.nodes.rest.Requests
189189
properties:
190190
hosts: [{ get_input: rest_endpoint }]
191191
port: 443

cloudify_rest/examples/example-2-blueprint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
node_templates:
1515

1616
user-details:
17-
type: cloudify.rest.Requests
17+
type: cloudify.nodes.rest.Requests
1818
properties:
1919
hosts: [{ get_input: rest_endpoint }]
2020
port: 443
@@ -27,7 +27,7 @@ node_templates:
2727
template_file: templates/get-user-all-properties-template.yaml
2828

2929
user-post:
30-
type: cloudify.rest.Requests
30+
type: cloudify.nodes.rest.Requests
3131
properties:
3232
hosts: [{ get_input: rest_endpoint }]
3333
port: 443

cloudify_rest/examples/example-3-blueprint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
node_templates:
1515

1616
token:
17-
type: cloudify.rest.Requests
17+
type: cloudify.nodes.rest.Requests
1818
properties:
1919
hosts: [{ get_input: mgmt_ip }]
2020
port: 443
@@ -30,7 +30,7 @@ node_templates:
3030
PASSWORD: "admin"
3131

3232
baseline_config:
33-
type: cloudify.rest.Requests
33+
type: cloudify.nodes.rest.Requests
3434
properties:
3535
hosts: [{ get_input: mgmt_ip }]
3636
port: 443
@@ -50,7 +50,7 @@ node_templates:
5050
target: token
5151

5252
baseline_networking:
53-
type: cloudify.rest.Requests
53+
type: cloudify.nodes.rest.Requests
5454
properties:
5555
hosts: [{ get_input: mgmt_ip }]
5656
port: 443

0 commit comments

Comments
 (0)