Skip to content

Commit ab40870

Browse files
authored
JIRA WDT-540 - Omit empty sections in VZ resource files; corrected prepareModel log message (#700)
1 parent 097e653 commit ab40870

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

core/src/main/python/prepare_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,17 +513,17 @@ def main():
513513
tool_exit.end(model_context, exit_code)
514514
except CompareException, ce:
515515
cla_helper.clean_up_temp_files()
516-
__logger.severe('WLSDPLY-05704', ce.getLocalizedMessage())
516+
__logger.severe('WLSDPLY-05801', ce.getLocalizedMessage())
517517
tool_exit.end(model_context, 2)
518518
except PyWLSTException, pe:
519519
cla_helper.clean_up_temp_files()
520-
__logger.severe('WLSDPLY-05704', pe.getLocalizedMessage())
520+
__logger.severe('WLSDPLY-05801', pe.getLocalizedMessage())
521521
tool_exit.end(model_context, 2)
522522
except:
523523
exc_type, exc_obj, exc_tb = sys.exc_info()
524524
eeString = traceback.format_exception(exc_type, exc_obj, exc_tb)
525525
cla_helper.clean_up_temp_files()
526-
__logger.severe('WLSDPLY-05704', eeString)
526+
__logger.severe('WLSDPLY-05801', eeString)
527527
tool_exit.end(model_context, 2)
528528

529529
def format_message(key, *args):

core/src/main/python/wlsdeploy/tool/util/targets/vz_config_helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
DOMAIN_PREFIX = 'domainPrefix'
3737
DOMAIN_UID = 'domainUid'
3838
DS_URL = 'url'
39+
HAS_CLUSTERS = 'hasClusters'
40+
HAS_DATABASES = 'hasDatabases'
3941
REPLICAS = 'replicas'
4042
WEBLOGIC_CREDENTIALS_SECRET = 'webLogicCredentialsSecret'
4143

@@ -122,6 +124,7 @@ def _build_template_hash(model, aliases):
122124
clusters.append(cluster_hash)
123125

124126
template_hash[CLUSTERS] = clusters
127+
template_hash[HAS_CLUSTERS] = len(clusters) != 0
125128

126129
# databases
127130

@@ -155,5 +158,6 @@ def _build_template_hash(model, aliases):
155158
databases.append(database_hash)
156159

157160
template_hash[DATABASES] = databases
161+
template_hash[HAS_DATABASES] = len(databases) != 0
158162

159163
return template_hash

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ WLSDPLY-05709=Fatal compare model error {0}
471471
WLSDPLY-05710=The models are identical
472472
WLSDPLY-05711=The model differences and output is written to the directory {0}
473473

474+
# prepare_model.py
475+
WLSDPLY-05801=Error in prepare model {0}
476+
474477
###############################################################################
475478
# Message number 06000 - 07999 Discover #
476479
###############################################################################

core/src/main/resources/oracle/weblogic/deploy/targets/vz/binding.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ spec:
1717
ingressBindings:
1818
- name: "{{{domainPrefix}}}-ingress"
1919
dnsName: "todo.vz.oracledx.com"
20+
{{#hasDatabases}}
2021
databaseBindings:
22+
{{/hasDatabases}}
2123
{{#databases}}
2224
- name: "{{{databasePrefix}}}-db"
2325
url: "{{{url}}}"

core/src/main/resources/oracle/weblogic/deploy/targets/vz/model.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ spec:
1717
- name: ocir
1818
logHomeEnabled: false
1919
logHome: {{{domainHome}}}/logs
20+
{{#hasClusters}}
2021
clusters:
22+
{{/hasClusters}}
2123
{{#clusters}}
2224
- clusterName: {{{clusterName}}}
2325
replicas: {{{replicas}}}
@@ -34,7 +36,9 @@ spec:
3436
match:
3537
- uri:
3638
prefix: "/todo"
39+
{{#hasDatabases}}
3740
- database:
41+
{{/hasDatabases}}
3842
{{#databases}}
3943
- target: {{{databasePrefix}}}-db
4044
datasourceName: {{{datasourceName}}}

0 commit comments

Comments
 (0)