Skip to content

Commit

Permalink
Merge pull request #569 from cloudify-cosmo/3.2.1-build
Browse files Browse the repository at this point in the history
3.2.1 build
  • Loading branch information
EarthmanT authored Oct 24, 2023
2 parents 41c8cb9 + 7553311 commit f1b7ae0
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
3.2.1: RND-1195 Add Subnet placement logic.
3.2.0: Support ECR.
3.1.9:
- add validate resource id are properly created (vpc, eni and sg)
Expand Down
2 changes: 1 addition & 1 deletion cloudify_aws/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '3.2.0'
version = '3.2.1'
13 changes: 10 additions & 3 deletions cloudify_aws/ec2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def untag(self, params):
self.logger.debug('Response: %s' % res)
return res

def get_available_zone(self, params):
def get_available_zone(self, rels, params):
"""method to get the first available zone given a region"""
self.logger.info('checking available zones given {0}'.format(params))
valid_zones = []
Expand All @@ -99,6 +99,13 @@ def get_available_zone(self, params):
if zone_state == 'available':
valid_zones.append(zone)
self.logger.info('valid zones {0}'.format(valid_zones))
if valid_zones and len(valid_zones) >= 1:
return valid_zones[0]
ZoneUsed = []
for rel in rels:
ZoneUsed.append(
rel.target.instance.runtime_properties['create_response'].get(
'AvailabilityZone'))
self.logger.info('ZoneUsed {0}'.format(ZoneUsed))
for zone in valid_zones:
if zone not in ZoneUsed:
return zone
return None
17 changes: 10 additions & 7 deletions cloudify_aws/ec2/resources/subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def prepare(ctx, resource_config, **_):
def create(ctx, iface, resource_config, **_):
'''Creates an AWS EC2 Subnet'''
resource_config = _create_subnet_params(resource_config, ctx.instance)
_create(ctx.node, iface, resource_config, ctx.logger)
_create(ctx, iface, resource_config)
utils.update_resource_id(ctx.instance, iface.resource_id)
_modify_attribute(iface, _.get('modify_subnet_attribute_args'))

Expand Down Expand Up @@ -209,7 +209,7 @@ def poststart(ctx, iface=None, **_):
utils.update_expected_configuration(iface, ctx.instance.runtime_properties)


def _create(ctx_node, iface, params, logger):
def _create(ctx, iface, params):
# Actually create the resource
try:
iface.create(params)
Expand All @@ -218,22 +218,25 @@ def _create(ctx_node, iface, params, logger):
'InvalidParameterValue' not in str(e):
raise e
config_from_utils = get_client_config(
ctx_node=ctx_node, alternate_key='aws_config')
ctx_node=ctx.node, alternate_key='aws_config')
region_name = config_from_utils.get('region_name')
use_available_zones = ctx_node.properties.get(
use_available_zones = ctx.node.properties.get(
'use_available_zones', False)
if use_available_zones:
logger.error(
ctx.logger.error(
"The Availability Zone chosen {0} "
"is not available".format(params['AvailabilityZone']))
rels = utils.find_rels_by_node_type(
ctx.instance,
'cloudify.nodes.aws.ec2.Subnet')
valid_zone = \
iface.get_available_zone({
iface.get_available_zone(rels, {
'Filters': [
{'Name': 'region-name', 'Values': [region_name]}
]
})
if valid_zone:
logger.error(
ctx.logger.error(
"using {0} Availability Zone instead".format(valid_zone))
params['AvailabilityZone'] = valid_zone
iface.create(params)
Expand Down
6 changes: 5 additions & 1 deletion cloudify_aws/eks/resources/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ def create(ctx, iface, resource_config, **_):

utils.update_resource_id(ctx.instance, resource_id)
iface = prepare_describe_cluster_filter(resource_config.copy(), iface)
iface.create(resource_config)
utils.exit_on_substring(iface,
'create',
resource_config,
['UnsupportedAvailabilityZoneException'],
raisable=NonRecoverableError)
if iface.create_response.get(CLUSTER):
utils.update_resource_arn(
ctx.instance, iface.create_response.get(CLUSTER).get(CLUSTER_ARN))
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
aws:
executor: central_deployment_agent
package_name: cloudify-aws-plugin
package_version: 3.2.0
package_version: 3.2.1

data_types:
cloudify.datatypes.swift.Connection:
Expand Down
2 changes: 1 addition & 1 deletion plugin_1_4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
aws:
executor: central_deployment_agent
package_name: cloudify-aws-plugin
package_version: 3.2.0
package_version: 3.2.1

data_types:
cloudify.datatypes.swift.Connection:
Expand Down
2 changes: 1 addition & 1 deletion plugin_1_5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
aws:
executor: central_deployment_agent
package_name: cloudify-aws-plugin
package_version: '3.2.0'
package_version: '3.2.1'
properties_description: |
Manage AWS resources.
Credentials documentation: https://docs.cloudify.co/latest/working_with/official_plugins/infrastructure/aws/#authentication-with-aws.
Expand Down
18 changes: 11 additions & 7 deletions python311.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
diff --git a/examples/blueprint-examples b/examples/blueprint-examples
--- a/examples/blueprint-examples
+++ b/examples/blueprint-examples
@@ -1 +1 @@
-Subproject commit a31b738d399857b00995b16de9fe47dae9b70c4a
+Subproject commit a31b738d399857b00995b16de9fe47dae9b70c4a-dirty
diff --git a/setup.py b/setup.py
index c97bce1..d21c1de 100644
index 4a8535b..7ad9067 100644
--- a/setup.py
+++ b/setup.py
@@ -39,9 +39,9 @@ setup(
@@ -39,8 +39,8 @@ setup(
'boto3',
'botocore',
'datetime',
- 'deepdiff==3.3.0',
- 'cloudify-common>=4.5',
+ 'deepdiff>=5.7.0',
- 'cloudify-common>=4.5,<7.0.0',
+ 'deepdiff==5.7.0',
+ 'cloudify-common>=7.0.0',
'pycryptodome==3.19.0',
- 'cloudify-utilities-plugins-sdk>=0.0.126',
+ 'cloudify-utilities-plugins-sdk>=0.0.128',
'cloudify-utilities-plugins-sdk>=0.0.128',
]
)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def get_version():
'botocore',
'datetime',
'deepdiff==3.3.0',
'cloudify-common>=4.5',
'cloudify-common>=4.5,<7.0.0',
'pycryptodome==3.19.0',
'cloudify-utilities-plugins-sdk>=0.0.126',
'cloudify-utilities-plugins-sdk>=0.0.128',
]
)
2 changes: 1 addition & 1 deletion v2_plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
aws:
executor: central_deployment_agent
package_name: cloudify-aws-plugin
package_version: 3.2.0
package_version: 3.2.1

data_types:
cloudify.datatypes.swift.Connection:
Expand Down

0 comments on commit f1b7ae0

Please sign in to comment.