I am making a tool so users can sink changelogs from new releases on perforce.
A user with certain rights has to login to download those logs. I need to get the p4 OAuth URL that returns when the p4 login command is ran.
This is what the code looks like in bash
p4 set P4PORT=ssl:XXXXXXXX
p4 set P4USER=XXXXXXXXX
p4 login > XXXXXXXX/temp/url.txt 2>&1 &
and that worked just fine. The url was printed out in the url.txt file.
I load this script as a template using python and write a new file with some changes, a number here a name there. I then call this script and then read the url from the file, but when I call it from my python code using
subprocess.run(['bash','XXXXXXXXXX/load_credentals.sh'])
A file url.txt is created, but it is empty.
I blocked out the file paths and ssh domain name for privacy reasons.
sysdig
, but if installing kernel modules isn't going to fly in your environment,strace -f
is better than nothing. Dig into what the threep4
calls actually do and where they fail, and you'll be in a better place to ask a question about the specific failure mode.exec >/tmp/p4-login-$$.log 2>&1; set -x
(after the shebang, of course), you'll have something logged, even if that something just shows what the p4 commands that are being invoked are.