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

openqa-cli: Avoid reading unexpectedly from STDIN #5894

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

Martchus
Copy link
Contributor

  • Avoid skipping the rest of a script when that script is invoked via sh < … and internally invokes openqa-cli (which in this case must not consume all remaining lines in that script)
  • Read only from STDIN if explicitly requested via --data-file - in consistency with curl (which also allows using - where a file can be specified to use STDIN)
  • See https://progress.opensuse.org/issues/160820

* Avoid skipping the rest of a script when that script is invoked via
  `sh < …` and internally invokes openqa-cli (which in this case must not
  consume all remaining lines in that script)
* Read only from STDIN if explicitly requested via `--data-file -` in
  consistency with curl (which also allows using `-` where a file can be
  specified to use STDIN)
* See https://progress.opensuse.org/issues/160820
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.71%. Comparing base (87b66ec) to head (de2a210).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5894      +/-   ##
==========================================
- Coverage   98.72%   98.71%   -0.01%     
==========================================
  Files         394      394              
  Lines       38659    38657       -2     
==========================================
- Hits        38167    38162       -5     
- Misses        492      495       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mergify mergify bot merged commit 18df607 into os-autoinst:master Aug 26, 2024
45 checks passed
@@ -32,11 +29,10 @@ sub command ($self, @args) {

@args = $self->decode_args(@args);
die $self->usage unless my $path = shift @args;
$data = $data_file eq '-' ? $self->data_from_stdin : path($data_file)->slurp if $data_file;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should also be added to the documentation in line 124

@Martchus Martchus deleted the stdin branch August 26, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants