@@ -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