|
18 | 18 | # CDDL HEADER END
|
19 | 19 |
|
20 | 20 | #
|
21 |
| -# Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. |
| 21 | +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. |
22 | 22 | #
|
23 | 23 |
|
24 | 24 | """
|
|
54 | 54 | print("Need Python 3, you are running {}".format(MAJOR_VERSION))
|
55 | 55 | sys.exit(1)
|
56 | 56 |
|
57 |
| -__version__ = "0.5" |
| 57 | +__version__ = "0.6" |
58 | 58 |
|
59 | 59 |
|
60 | 60 | def exec_command(doit, logger, cmd, msg):
|
@@ -148,20 +148,18 @@ def config_refresh(doit, logger, basedir, uri, configmerge, jar_file,
|
148 | 148 | else:
|
149 | 149 | logger.info('Refreshing configuration '
|
150 | 150 | '(merging with read-only config)')
|
151 |
| - configmerge_cmd = configmerge |
152 |
| - configmerge_cmd.extend(['-a', jar_file, roconfig, fcur.name]) |
153 |
| - if java: |
154 |
| - configmerge_cmd.append('-j') |
155 |
| - configmerge_cmd.append(java) |
156 |
| - merged_config = exec_command(doit, logger, |
157 |
| - configmerge_cmd, |
158 |
| - "cannot merge configuration") |
159 | 151 | with tempfile.NamedTemporaryFile() as fmerged:
|
160 | 152 | logger.debug("Temporary file for merged config: {}".
|
161 | 153 | format(fmerged.name))
|
| 154 | + configmerge_cmd = configmerge |
| 155 | + configmerge_cmd.extend(['-a', jar_file, roconfig, fcur.name, fmerged.name]) |
| 156 | + if java: |
| 157 | + configmerge_cmd.append('-j') |
| 158 | + configmerge_cmd.append(java) |
| 159 | + exec_command(doit, logger, |
| 160 | + configmerge_cmd, |
| 161 | + "cannot merge configuration") |
162 | 162 | if doit:
|
163 |
| - fmerged.write(bytearray(''.join(merged_config), "UTF-8")) |
164 |
| - fmerged.flush() |
165 | 163 | install_config(doit, logger, fmerged.name, main_config)
|
166 | 164 |
|
167 | 165 |
|
@@ -251,7 +249,7 @@ def main():
|
251 | 249 | parser.add_argument('-U', '--uri', default='http://localhost:8080/source',
|
252 | 250 | help='URI of the webapp with context path')
|
253 | 251 | parser.add_argument('-c', '--configmerge',
|
254 |
| - help='path to the ConfigMerge binary') |
| 252 | + help='path to the ConfigMerge program') |
255 | 253 | parser.add_argument('--java', help='Path to java binary '
|
256 | 254 | '(needed for config merge program)')
|
257 | 255 | parser.add_argument('-j', '--jar', help='Path to jar archive to run')
|
@@ -315,7 +313,7 @@ def main():
|
315 | 313 |
|
316 | 314 | # If read-only configuration file is specified, this means read-only
|
317 | 315 | # configuration will need to be merged with active webapp configuration.
|
318 |
| - # This requires config merge tool to be run so couple of other things |
| 316 | + # This requires config merge tool to be run so a couple of other things |
319 | 317 | # need to be checked.
|
320 | 318 | if args.roconfig:
|
321 | 319 | if path.isfile(args.roconfig):
|
|
0 commit comments