PP-484: PP-485: Enhance output of qstat to make it more admin and script friendly


#21

We’ve moved this topic into the Developer area, so all now matches expectations.


#22

Thanks, @iestockdale for moving it into the developer discussion.

That’s correct Jon, special characters will break the json.
\" quotation mark \\ reverse solidus \b backspace \f formfeed \n newline \r carriage return \t horizontal tab
They need to be escaped as mentioned in http://json.org/. Thanks for bringing this up.


#23

Thanks Jon and Nithin. Nithin, when you are able, please provide example output showing exactly what this will (or already does) look like in new qstat output.


#24

I’ve attached sample output for the special case (where the user variables contains special characters) with the document -
EDD for enhancing qstat output.


#25

Hello Nithin,

Have you tried running your examples through a JSON parser like the one in Python?
Do you get your original input back when you re-encode the dictionary?

Thanks,

Mike


#26

Yes @mkaro. I’ ve tested it using the Python json module. Details are attached with the ticket.
You can also review the pull request raised for this.
Thanks.


#27

Specifically, have you tried calling json.dump() or json.dumps() to serialize the decoded dictionary back into JSON format?


#28

Yes. I’m getting the results in json format. I’ve attached the results with ticket.


#29

Does the EDD need tp specifically call out that the new interface options can also be used with job history options (-x, -H) when -f is also used, or is that implied by the applicable qstat usage statement already:

qstat [-f] [-J] [-p] [-t] [-x] [-E] [ job_identifier… | destination… ]

?


#30

Hi @scc
There is a note section at the bottom of the page which states
All the three new interfaces will be supported only with full set of attributes (" -f " option). This would include every vaild combination of "-f"
So the new interfaces will work with history jobs when you use the qstat -xf option. The H option is not supported with -f.


#31

I read somewhere in your EDD that backslash (\) will be used to escape the given delimiter character if it appears in the output. Consider looking into this EDD:

https://pbspro.atlassian.net/wiki/pages/viewpage.action?pageId=50630196

For Windows, please use the caret (^) as the escape character as the backslash is actually a legal pathname charcter under Windows.


#32

Thanks, @bayucan. It should have resulted in a potential bug if PP-668 gone in since I’m looking for the escape character (\ today) while parsing for json to print values without any escaping.
However, I prefer to have the same escape character for all platforms. So Caret will be used as the escape character in DSV format instead of Backslash.


#33

My earlier conclusion was wrong regarding the escape character in DSV. It is better to keep the same escaping character used with qstat -f. So DSV will use backslash on Linux and Caret on Windows for consistency.


#34

Sounds good. EDD looks fine now.