Skip to content

Commit 9bdc7ef

Browse files
committed
Fixes for CPU, Mem in CMP
1 parent 05e950d commit 9bdc7ef

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

onefuse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
Enables the execution of OneFuse policies via Python
55
"""
66

7-
__version__ = "2022.3.1"
7+
__version__ = "2022.3.2"
88
__credits__ = 'Cloudbolt Software, Inc.'

onefuse/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,8 @@ def render(self, template: str, template_properties: dict,
966966
Set). Default: "value"
967967
"""
968968
try:
969+
if type(template) != str:
970+
return template
969971
if template.find('{%') == -1 and template.find('{{') == -1:
970972
return template
971973
json_template = {

onefuse/backups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def restore_single_policy(self, json_path: str, overwrite: bool = False):
495495
detail = response.json()["detail"]
496496
except:
497497
self.ofm.logger.error('Response JSON detail cannot be '
498-
'accessed', response=response)
498+
f'accessed. response: {response}')
499499
raise
500500
if detail == 'Not found.':
501501
# This may happen when script is run against older

onefuse/cloudbolt_admin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ def render_and_apply_properties(self, properties: dict, resource,
170170
from infrastructure.models import Environment
171171
resource.environment = Environment.objects.filter(
172172
name=rendered_value).first()
173+
elif rendered_key == 'cpu_cnt':
174+
resource.cpu_cnt = rendered_value
175+
resource.save()
176+
elif rendered_key == 'mem_size':
177+
resource.mem_size = rendered_value
178+
resource.save()
173179
else:
174180
try:
175181
resource.set_value_for_custom_field(rendered_key,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='onefuse',
8-
version='2022.3.1',
8+
version='2022.3.2',
99
author='Cloudbolt Software, Inc.',
1010
author_email='support@cloudbolt.io',
1111
description='OneFuse upstream provider package for Python',

0 commit comments

Comments
 (0)