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

Add option to specify tars to check or extract #170

Merged
merged 1 commit into from
Dec 11, 2021

Conversation

forsyth2
Copy link
Collaborator

Specify starting tar. Resolves #164.

@forsyth2 forsyth2 added enhancement semver: new feature New feature (will increment minor version) labels Nov 29, 2021
@forsyth2 forsyth2 self-assigned this Nov 29, 2021
@forsyth2 forsyth2 marked this pull request as draft November 29, 2021 21:36
@forsyth2 forsyth2 force-pushed the specify-starting-tar branch 7 times, most recently from c8164ba to baffaaa Compare December 3, 2021 01:08
@forsyth2 forsyth2 marked this pull request as ready for review December 3, 2021 01:24
Copy link
Collaborator Author

@forsyth2 forsyth2 left a comment

Choose a reason for hiding this comment

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

@golaz This is ready for review.

Comment on lines 208 to 231
else: # TODO: should this always be run (i.e., not if/else?)
# Find matching files
for args_file in args.files:
cur.execute(
u"select * from files where name GLOB ? or tar GLOB ?",
(args_file, args_file),
)
matches_ = matches_ + cur.fetchall()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we still run this section if --tars is being used? That is, is there a use case where a user would specify zstash check --hpss=<HPSS> --tars=<tars> <specific files>? It seems like if a user is requesting specific files, it wouldn't be necessary to specify which tars to look at.

Copy link

Choose a reason for hiding this comment

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

That's right. When specifying the tar files, we don't need the --tars option - It's redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tangq If a user specifies both <tars> and <specific files>, what should be the expected behavior?

  1. Just check/extract <tars>
  2. Just check/extract <specific files>
  3. Print error message saying to only specify one

Copy link

Choose a reason for hiding this comment

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

I'd say option 3. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would agree. @golaz which is your preference?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@forsyth2 and @tangq : this is an edge case and I would think that it is unlikely a user would want to specify <tars> and <specific files> simultaneously. Therefore, if it's relatively straightforward to implement, I would suggest option 3 as well to make sure there is no room for misunderstanding from an unsuspecting user.

Copy link

@tangq tangq left a comment

Choose a reason for hiding this comment

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

Looks good by visual check. If testing successfully and removing the redundant --tars option when specifying the file names to check, it can be merged.

Comment on lines 208 to 231
else: # TODO: should this always be run (i.e., not if/else?)
# Find matching files
for args_file in args.files:
cur.execute(
u"select * from files where name GLOB ? or tar GLOB ?",
(args_file, args_file),
)
matches_ = matches_ + cur.fetchall()
Copy link

Choose a reason for hiding this comment

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

That's right. When specifying the tar files, we don't need the --tars option - It's redundant.

Copy link
Collaborator

@golaz golaz left a comment

Choose a reason for hiding this comment

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

@forsyth2 : the code looks good. I made a few minor suggestions. Let me know if you'd like me to try it out myself.

zstash/extract.py Show resolved Hide resolved
zstash/extract.py Show resolved Hide resolved
@forsyth2 forsyth2 force-pushed the specify-starting-tar branch 3 times, most recently from de9857b to e139de7 Compare December 6, 2021 23:49
@forsyth2
Copy link
Collaborator Author

forsyth2 commented Dec 6, 2021

@golaz @tangq I created a commit addressing your comments: e139de7

Let me know if that looks good. If so, I'll squash and merge this pull request.

@golaz
Copy link
Collaborator

golaz commented Dec 7, 2021

Thanks @forsyth2. The changes look good to me.

@forsyth2 forsyth2 force-pushed the specify-starting-tar branch from e139de7 to 1f8dbe3 Compare December 11, 2021 00:32
@forsyth2 forsyth2 changed the title Specify starting tar Add option to specify tars to check or extract Dec 11, 2021
@forsyth2 forsyth2 merged commit fb39bbc into E3SM-Project:master Dec 11, 2021
@forsyth2 forsyth2 deleted the specify-starting-tar branch December 11, 2021 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: new feature New feature (will increment minor version)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

specify the starting tar file for checking or parallel checking
3 participants