Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly call tree.get() for timestamp handling #1974

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/8623.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed sync/migration of the kickstart repositories with floating point build_timestamp.
2 changes: 1 addition & 1 deletion pulp_rpm/app/kickstart/treeinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def parsed_sections(self):
tree = self.original_parser._sections.get("tree", {})

if "." in str(tree.get("build_timestamp")):
build_timestamp = float(tree.get["build_timestamp"])
build_timestamp = float(tree.get("build_timestamp"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my... 🤦‍♀️
We need to add a repo with such timestamp to our testing suite. @jlsherrill , do you have an idea which repos the user has the problem with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user here that filed this issue: https://pulp.plan.io/issues/5989 said centos7 has this issue, but i couldn't seem to find a centos7 repo that had it: https://mirror.linux.duke.edu/pub/centos/7/os/x86_64/.treeinfo

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CentOS 8 has it, e.g. http://mirror.centos.org/centos/8/BaseOS/x86_64/kickstart/.treeinfo

@gvde , thanks, the build_timestamp we can find but I'm looking for a timestamp which will be of a floating point type, not the integer.
E.g. build_timestamp = 1605735523.0

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goosemania Sorry. I have missed that detail. For what it's worth, looking at the latest mirrored repositories: CentOS 7 doesn't have any build_timestamp. CentOS 8.3.2011 and Stream have only integer. So no help there...


if build_timestamp and parser._sections.get("general", {}).get("timestamp"):
parser._sections["general"]["timestamp"] = build_timestamp
Expand Down