Skip to content

Commit 9fde03a

Browse files
committed
ID-27: 'buildfed' will not update the in-memory entity store in simulation mode
1 parent 7ed7926 commit 9fde03a

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

CHANGELOG.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
Remark: MinGW is provided as part of Git for Windows.
1212
This enhancement allows to execute the plugin within a Git Bash shell on Windows.
13+
14+
|https://github.com/Axway-API-Management-Plus/apigw-maven-plugin/issues/27[#27]
15+
|Bug
16+
|The `buildfed` shall not update the in-memory entity store in simulation mode.
1317
|===
1418

1519

src/main/resources/scripts/lib/fedconfig.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,24 @@ def __configure_entities(self):
9494
if (field_value.value is not None):
9595
logging.info("Configure field: name=%s; index=%d; type=%s; entity=%s" % (field_value.key.name, field_value.key.index, field_value.key.type, field_value.key.short_hand_key))
9696

97-
if field_value.key.short_hand_key not in config:
98-
config[field_value.key.short_hand_key] = []
97+
if not self.__simulation_mode:
98+
if field_value.key.short_hand_key not in config:
99+
config[field_value.key.short_hand_key] = []
99100

100-
if field_value.key.type == "integer":
101-
config[field_value.key.short_hand_key].append([field_value.key.name, field_value.key.index, int(field_value.value)])
102-
else:
103-
config[field_value.key.short_hand_key].append([field_value.key.name, field_value.key.index, str(field_value.value)])
101+
if field_value.key.type == "integer":
102+
config[field_value.key.short_hand_key].append([field_value.key.name, field_value.key.index, int(field_value.value)])
103+
else:
104+
config[field_value.key.short_hand_key].append([field_value.key.name, field_value.key.index, str(field_value.value)])
104105
else:
105106
logging.error("Unconfigured field: name=%s; index=%d; type=%s; entity=%s" % (field_value.key.name, field_value.key.index, field_value.key.type, field_value.key.short_hand_key))
106107
succeeded = False
107108

108109
if succeeded:
109-
fed_api.addEnvSettings(config)
110-
logging.info("Environmentalized fields updated.")
110+
if not self.__simulation_mode:
111+
fed_api.addEnvSettings(config)
112+
logging.info("Environmentalized fields updated.")
113+
else:
114+
logging.info("[SIMULATION_MODE] Environmentalized fields simulation succeeded.")
111115

112116
self.__config.update_config_file()
113117

@@ -245,8 +249,11 @@ def __configure_certificates(self):
245249
if has_expired:
246250
raise ValueError("At least one certificate expires in less than %i days; check log file!" % (self.__expiration_days))
247251

248-
DeploymentArchive.updateConfiguration(self.__fed_archive, es.es)
249-
logging.info("Certificates updated.")
252+
if not self.__simulation_mode:
253+
DeploymentArchive.updateConfiguration(self.__fed_archive, es.es)
254+
logging.info("Certificates updated.")
255+
else:
256+
logging.info("[SIMULATION_MODE] Certificates simulation succeeded.")
250257
return True
251258

252259
def get_unconfigured_fields(self):

0 commit comments

Comments
 (0)