Skip to content

Commit 4580c2e

Browse files
committed
revert latest timestamp changes for extra key level
1 parent a63fa1f commit 4580c2e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

ansible/library/latest_timestamps.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,17 @@ def run_module():
5252
)
5353

5454
timestamps = dict(module.params['repos_dict'])
55-
for index in timestamps:
56-
for repo in timestamps[index]:
57-
for version in timestamps[index][repo]:
55+
for repo in timestamps:
56+
for version in timestamps[repo]:
5857

59-
html_txt = requests.get(
60-
url= module.params['content_url'] + '/' + timestamps[index][repo][version]['pulp_path']
61-
).text
62-
timestamp_link_list = BeautifulSoup(html_txt,features="html.parser").body.find('pre').find_all() # getting raw list of timestamps from html
63-
timestamp_link_list = map(lambda x: x.string,timestamp_link_list) # stripping xml tags
64-
latest_timestamp = list(timestamp_link_list)[-1][:-1] # last timestamp in list with trailing / removed
65-
timestamps[index][repo][version]['pulp_timestamp'] = latest_timestamp
66-
# timestamps[index] = dict(sorted(timestamps[index]))
67-
68-
69-
result['timestamps'] = timestamps
58+
html_txt = requests.get(
59+
url= module.params['content_url'] + '/' + timestamps[repo][version]['pulp_path']
60+
).text
61+
timestamp_link_list = BeautifulSoup(html_txt,features="html.parser").body.find('pre').find_all() # getting raw list of timestamps from html
62+
timestamp_link_list = map(lambda x: x.string,timestamp_link_list) # stripping xml tags
63+
latest_timestamp = list(timestamp_link_list)[-1][:-1] # last timestamp in list with trailing / removed
64+
timestamps[repo][version]['pulp_timestamp'] = latest_timestamp
65+
result['timestamps'] = dict(sorted(timestamps.items()))
7066

7167
module.exit_json(**result)
7268

0 commit comments

Comments
 (0)