Skip to content

Commit

Permalink
CYBL-1809-Fix-Resource-Downloader (#213)
Browse files Browse the repository at this point in the history
* CYBL-1809-Fix-Resource-Downloader

* CYBL-1809-Bump-SDK
  • Loading branch information
ahmadiesa-abu authored Sep 6, 2022
1 parent 24cf075 commit 0c35fe8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.19.4:
- Better handle for get_shared_resource credentials and file resources.
0.19.3:
- Rebuild the plugin to bump cloudify_common_sdk version.
0.19.2:
Expand Down
10 changes: 8 additions & 2 deletions cloudify_tf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ def update_terraform_source_material(new_source, target=False):
new_source_password = new_source.get('password')
ctx.logger.debug('Getting shared resource: {} to {}'.format(
new_source_location, node_instance_dir))
if isinstance(new_source_username, CommonSDKSecret):
new_source_username = new_source_username.secret
if isinstance(new_source_password, CommonSDKSecret):
new_source_password = new_source_password.secret
source_tmp_path = get_shared_resource(
new_source_location, dir=node_instance_dir,
username=new_source_username,
Expand All @@ -327,8 +331,10 @@ def update_terraform_source_material(new_source, target=False):
# check if we actually downloaded something or not
if source_tmp_path == new_source_location:
source_tmp_path, delete_tmp = _create_source_path(source_tmp_path)
# move tmp files to correct directory
copy_directory(source_tmp_path, node_instance_dir)
# move tmp files to correct directory if tmp_path is directory otherwise
# the resources will be downloaded inside the node_instance_dir
if os.path.isdir(source_tmp_path):
copy_directory(source_tmp_path, node_instance_dir)
# By getting here we will have extracted source
# Zip the file to store in runtime
if not v1_gteq_v2(get_cloudify_version(), "6.0.0"):
Expand Down
2 changes: 1 addition & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cloudify-utilities-plugins-sdk>=0.0.82
cloudify-utilities-plugins-sdk>=0.0.85
urllib3==1.24.3
networkx==1.9.1
cryptography>=3.3.2
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:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.19.3'
package_version: '0.19.4'

dsl_definitions:

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:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.19.3'
package_version: '0.19.4'

dsl_definitions:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_version(rel_file='plugin.yaml'):
"cloudify-common>=4.5.5",
"networkx==1.9.1",
"requests>=2.7.0,<3.0",
"cloudify-utilities-plugins-sdk>=0.0.82",
"cloudify-utilities-plugins-sdk>=0.0.85",
],
test_requires=[
"cloudify-common>=4.5.5",
Expand Down
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:
tf:
executor: central_deployment_agent
package_name: cloudify-terraform-plugin
package_version: '0.19.3'
package_version: '0.19.4'

dsl_definitions:

Expand Down

0 comments on commit 0c35fe8

Please sign in to comment.