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

BUG: happi update functionality changed #319

Open
tangkong opened this issue Jul 24, 2023 · 0 comments
Open

BUG: happi update functionality changed #319

tangkong opened this issue Jul 24, 2023 · 0 comments

Comments

@tangkong
Copy link
Contributor

Expected Behavior

happi update should work intuitively, or at least be clear about how to use it.

Current Behavior

In the past, it was possible to pipe json into happi update. This appears to no longer be the case.

The following no longer works: cat my.json | happi update

but this works for him: happi update $(cat my.json)

Possible Solution

Two-fold:

  • be smarter about parsing the json input
  • Improve documentation on using this

Steps to Reproduce (for bugs)

  1. Create a json file -> my.json
  2. try cat my.json | happi update

Context

This was reported by @untzag (thank you!)

Some points revealed as I investigated. happi update:

  • expects a list of json "dictonaries", not a single dictionary with
    • This means if you are using the json backend and simply copy an entry, this will fail
  • fails on cat my.json | happi update
    • happi does not receive any json data, but you actually need to use xargs. in other words, this is expected to fail
  • eats quotations if you try cat my.json | xargs happi update
    • failure comes from json expecting double quotes around field names and not finding them

Your Environment

happi 2.3.0

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

No branches or pull requests

1 participant