Skip to content

Commit 504dd84

Browse files
committed
Comment original kvstore activation logic
1 parent 309d358 commit 504dd84

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

contentctl/objects/content_versioning_service.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,19 @@ def _query_content_versioning_service(
197197

198198
# Query the content versioning service
199199
try:
200-
if method == "GET" and self.kvstore_content_versioning:
201-
response = self.service.request(
202-
method=method,
203-
path_segment="content_versioning/versioning_apps",
204-
app="SA-ContentVersioning",
205-
)
206-
if self.indexbased_content_versioning:
207-
response = self.service.request( # type: ignore
208-
method=method,
209-
path_segment="configs/conf-feature_flags/general",
210-
body=body,
211-
app="SA-ContentVersioning",
212-
)
200+
# if method == "GET" and self.kvstore_content_versioning:
201+
# response = self.service.request(
202+
# method=method,
203+
# path_segment="content_versioning/versioning_apps",
204+
# app="SA-ContentVersioning",
205+
# )
206+
# if self.indexbased_content_versioning:
207+
response = self.service.request( # type: ignore
208+
method=method,
209+
path_segment="configs/conf-feature_flags/general",
210+
body=body,
211+
app="SA-ContentVersioning",
212+
)
213213
except HTTPError as e:
214214
# Raise on any HTTP errors
215215
raise HTTPError(f"Error querying content versioning service: {e}") from e
@@ -248,26 +248,26 @@ def is_versioning_activated(self) -> bool:
248248

249249
# Find the versioning_activated field and report any errors
250250
try:
251-
if self.kvstore_content_versioning:
252-
if "content" in data:
253-
for app in data["content"]:
254-
if app.get("name") == "DA-ESS-ContentUpdate":
255-
# If there is error message versioning is not activated properly
256-
if "message" in app:
257-
return False
258-
259-
# If the installed verion is not the same as the test version
260-
if app.get("version") != self.global_config.app.version:
261-
return False
262-
263-
if app.get("status") == "active":
264-
return True
265-
else:
266-
return False
267-
if self.indexbased_content_versioning:
268-
for entry in data["entry"]:
269-
if entry["name"] == "general":
270-
return bool(int(entry["content"]["versioning_activated"]))
251+
# if self.kvstore_content_versioning:
252+
# if "content" in data:
253+
# for app in data["content"]:
254+
# if app.get("name") == "DA-ESS-ContentUpdate":
255+
# # If there is error message versioning is not activated properly
256+
# if "message" in app:
257+
# return False
258+
259+
# # If the installed verion is not the same as the test version
260+
# if app.get("version") != self.global_config.app.version:
261+
# return False
262+
263+
# if app.get("status") == "active":
264+
# return True
265+
# else:
266+
# return False
267+
# if self.indexbased_content_versioning:
268+
for entry in data["entry"]:
269+
if entry["name"] == "general":
270+
return bool(int(entry["content"]["versioning_activated"]))
271271
except KeyError as e:
272272
raise KeyError(
273273
"Cannot retrieve versioning status, unable to determine versioning status using "
@@ -288,13 +288,13 @@ def activate_versioning(self) -> None:
288288
)
289289

290290
# Wait for versioning to be activated for ES 8.3.0+
291-
if self.kvstore_content_versioning:
292-
timeout = 600
293-
while not self.is_versioning_activated:
294-
time.sleep(60)
295-
timeout -= 60
296-
if timeout <= 0:
297-
break
291+
# if self.kvstore_content_versioning:
292+
# timeout = 600
293+
# while not self.is_versioning_activated:
294+
# time.sleep(60)
295+
# timeout -= 60
296+
# if timeout <= 0:
297+
# break
298298

299299
# Confirm versioning has been enabled
300300
if not self.is_versioning_activated:

0 commit comments

Comments
 (0)