Skip to content

Commit ba06653

Browse files
committed
Use domain schema generated by oracle.weblogic.deploy.updateschema.SchemaUpdater in wls-deploy-integration-test
1 parent 9d4a8d0 commit ba06653

File tree

5 files changed

+23
-13600
lines changed

5 files changed

+23
-13600
lines changed

core/src/main/python/wlsdeploy/tool/extract/wko_schema_helper.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
from oracle.weblogic.deploy.util import FileUtils
@@ -15,11 +15,17 @@
1515
DOMAIN_RESOURCE_SCHEMA_PATH = 'oracle/weblogic/deploy/wko/' + DOMAIN_RESOURCE_SCHEMA_FILE
1616

1717
SIMPLE_TYPES = [
18+
'integer',
1819
'number',
1920
'string',
2021
'boolean'
2122
]
2223

24+
OBJECT_TYPES = [
25+
'object',
26+
None
27+
]
28+
2329
UNSUPPORTED_FOLDERS = [
2430
'status',
2531
'metadata/initializers',
@@ -63,7 +69,7 @@ def is_single_folder(schema_map):
6369
:return: True if the map identifies a single folder
6470
"""
6571
property_type = get_type(schema_map)
66-
if property_type == "object":
72+
if property_type in OBJECT_TYPES:
6773
return get_map_element_type(schema_map) is None
6874
return False
6975

@@ -76,7 +82,7 @@ def is_multiple_folder(schema_map):
7682
"""
7783
property_type = get_type(schema_map)
7884
if property_type == "array":
79-
return get_array_element_type(schema_map) == "object"
85+
return get_array_element_type(schema_map) in OBJECT_TYPES
8086
return False
8187

8288

@@ -91,7 +97,7 @@ def is_simple_map(schema_map):
9197
:return: True if the map identifies a simple map
9298
"""
9399
property_type = get_type(schema_map)
94-
if property_type == "object":
100+
if property_type in OBJECT_TYPES:
95101
return get_map_element_type(schema_map) is not None
96102
return False
97103

@@ -104,7 +110,7 @@ def is_simple_array(schema_map):
104110
"""
105111
property_type = get_type(schema_map)
106112
if property_type == "array":
107-
return get_array_element_type(schema_map) != "object"
113+
return get_array_element_type(schema_map) not in OBJECT_TYPES
108114
return False
109115

110116

@@ -123,7 +129,8 @@ def get_array_item_info(schema_map):
123129

124130

125131
def get_properties(schema_map):
126-
return dictionary_utils.get_element(schema_map, "properties")
132+
properties = dictionary_utils.get_element(schema_map, "properties")
133+
return properties or {}
127134

128135

129136
def get_type(schema_map):

core/src/main/python/wlsdeploy/tool/modelhelp/model_kubernetes_printer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
from wlsdeploy.exception import exception_helper
@@ -200,9 +200,10 @@ def _print_attributes_sample(self, schema_folder, indent_level):
200200
def _get_properties(schema_folder):
201201
# in array elements, the properties are under "items"
202202
if wko_schema_helper.is_multiple_folder(schema_folder):
203-
return schema_folder['items']['properties']
203+
item_info = wko_schema_helper.get_array_item_info(schema_folder)
204+
return wko_schema_helper.get_properties(item_info)
204205
else:
205-
return schema_folder['properties']
206+
return wko_schema_helper.get_properties(schema_folder)
206207

207208

208209
def _get_folder_names(schema_properties):

0 commit comments

Comments
 (0)