Skip to content

Commit

Permalink
Merge pull request #174 from cloudify-cosmo/CYBL-1111-Fix-ManagedClus…
Browse files Browse the repository at this point in the history
…terCreate

__NODOCS__
  • Loading branch information
ahmadiesa-abu authored Feb 28, 2021
2 parents e406be7 + 28ae8ae commit 82dd4e5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
3.0.10: Fix some bugs related to create managed_cluster/network_security_rule/storage_account
3.0.9: Upgrade PyYAML.
3.0.8: Add resource group name to deployment and default to deployment name.
3.0.7: Handle Public IPs.
Expand Down
4 changes: 2 additions & 2 deletions cloudify_azure/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def wrapper_inner(*args, **kwargs):
name=name,
rtbl_name=rtbl_name)
# network_security_rule
elif isinstance(resource, Route):
elif isinstance(resource, NetworkSecurityRule):
nsg_name = utils.get_network_security_group(ctx)
name = get_unique_name(
resource=resource,
Expand Down Expand Up @@ -188,7 +188,7 @@ def wrapper_inner(*args, **kwargs):
rtbl_name = utils.get_route_table(ctx)
result = resource.get(resource_group_name, rtbl_name, name)
# network_security_rule
elif isinstance(resource, Route):
elif isinstance(resource, NetworkSecurityRule):
nsg_name = utils.get_network_security_group(ctx)
result = resource.get(resource_group_name, nsg_name, name)
else:
Expand Down
2 changes: 1 addition & 1 deletion cloudify_azure/resources/storage/storageaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def delete(ctx, **_):
else:
ctx.logger.warn("azure_config is deprecated please use client_config, "
"in later version it will be removed")
resource_group_name = utils.get_resource_group(ctx)
resource_group_name = utils.get_resource_group(ctx)
name = ctx.instance.runtime_properties.get('name')
api_version = \
ctx.node.properties.get('api_version', constants.API_VER_STORAGE)
Expand Down
14 changes: 4 additions & 10 deletions cloudify_azure/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
~~~~~
Microsoft Azure plugin for Cloudify helper utilities
"""
import re

from collections import Mapping

Expand Down Expand Up @@ -331,16 +332,9 @@ def cleanup_empty_params(data):
"""

def convert_key_val(key):
# handle special case where -IP- inside the key
if 'IP' in key:
key = key.replace('IP', 'Ip')
new_key = key[0].lower()
for character in key[1:]:
# Append an underscore if the character is uppercase.
if character.isupper():
new_key += '_'
new_key += character.lower()
return new_key
# convert from CamelCase to snake_case
key = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', key)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', key).lower()

if type(data) is dict:
new_data = {}
Expand Down
4 changes: 2 additions & 2 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
plugins:
azure:
executor: central_deployment_agent
source: https://github.com/cloudify-cosmo/cloudify-azure-plugin/archive/3.0.9.zip
source: https://github.com/cloudify-cosmo/cloudify-azure-plugin/archive/3.0.10.zip
package_name: cloudify-azure-plugin
package_version: '3.0.9'
package_version: '3.0.10'

data_types:
cloudify.datatypes.azure.Config:
Expand Down

0 comments on commit 82dd4e5

Please sign in to comment.