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

'rucio-admin rse info' should print protocol domain data as valid JSON #4027

Closed
mkszuba opened this issue Sep 25, 2020 · 1 comment
Closed

Comments

@mkszuba
Copy link

mkszuba commented Sep 25, 2020

Motivation

'rucio-admin rse add-protocol' expects domain data to be formatted as valid JSON, i.e. with both keys and scalar values quoted using double quotes. However, the same domain data when printed by 'rucio-admin rse info' is formatted differently - keys are quoted using single quotes, scalar values (or at least numerical ones) are not quoted at all. This both is inconsistent and prevents feeding domain data retrieved with the latter command to the former without extensive editing.

Modification

The function info_rse() in rucio-admin currently prints all protocol information by simply stringifying relevant dict items. The simplest way of outputting valid JSON for domain data would be to make the protocol-item loop (lines 566-567) consider the key 'domains' a special case, invoking json.dumps() rather than str(); a more sophisticated approach would overload the method __str__() of the domain dict to call json.dumps() internally.

@bari12
Copy link
Member

bari12 commented Sep 25, 2020

I think we can just do the json.dumps() as you suggested for rucio-admin rse info. That should be easy to add.

mlassnig added a commit to mlassnig/rucio that referenced this issue Oct 26, 2020
@bari12 bari12 closed this as completed in 62ec46b Oct 27, 2020
bari12 pushed a commit that referenced this issue Oct 27, 2020
* Clients: JSON-formatted output for domains; Fix #4027
* fix for docker environment variable magic
@bari12 bari12 added this to the 1.23.9-clients milestone Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants