Skip to content

Commit 95bb44e

Browse files
Fixing some brownfield and env fixes
1 parent 4797f32 commit 95bb44e

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

calm/dsl/builtins/models/brownfield.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_ahv_bf_vm_data(
9797
cluster_uuid = clusters[0]["uuid"]
9898

9999
params = {
100-
"length": 250,
100+
"length": 1000,
101101
"offset": 0,
102102
"filter": "project_uuid=={};account_uuid=={}".format(
103103
project_uuid, cluster_uuid
@@ -233,7 +233,7 @@ def get_azure_bf_vm_data(
233233
client = get_api_client()
234234

235235
params = {
236-
"length": 250,
236+
"length": 1000,
237237
"offset": 0,
238238
"filter": "project_uuid=={};account_uuid=={}".format(
239239
project_uuid, account_uuid
@@ -259,6 +259,10 @@ def get_azure_bf_vm_data(
259259
e_id = e_resources["instance_id"]
260260
e_address = e_resources["address"]
261261
e_address_list = e_resources["public_ip_address"]
262+
e_private_address = e_resources["private_ip_address"]
263+
if (not e_address_list) and e_private_address:
264+
e_address = [e_private_address]
265+
e_address_list = e_private_address
262266

263267
if match_vm_data(
264268
vm_name=e_name,

calm/dsl/cli/environments.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,19 @@ def compile_environment_dsl_class(env_cls, metadata=dict()):
8181
for sub in env_payload["spec"]["resources"].get("substrate_definition_list", []):
8282
sub["uuid"] = str(uuid.uuid4())
8383

84-
# TODO check if credential ref is working in readiness_probe and other places
84+
# Adding uuid readiness-probe
85+
cred_name_uuid_map = {}
86+
for cred in env_payload["spec"]["resources"].get("credential_definition_list", []):
87+
cred_name_uuid_map[cred["name"]] = cred["uuid"]
88+
89+
for sub in env_payload["spec"]["resources"].get("substrate_definition_list", []):
90+
try:
91+
cred_ref_obj = sub["readiness_probe"]["login_credential_local_reference"]
92+
cred_ref_obj["uuid"] = cred_name_uuid_map[cred_ref_obj["name"]]
93+
except Exception:
94+
pass
95+
96+
# TODO check if credential ref is working in attributes consuming credentials
8597

8698
return env_payload
8799

0 commit comments

Comments
 (0)