Skip to content

Commit

Permalink
pmdahaproxy: fix connect script handling of string quoting
Browse files Browse the repository at this point in the history
From qa/1110 on rawhide
> $PCP_VAR_DIR/pmdas/haproxy/connect:60: SyntaxWarning: invalid escape sequence '\&'

Python 3.12 is producing errors on invalid escape sequences
embedded in strings on rawhide - use double-backslash which
seems to be the original intention here.
  • Loading branch information
natoscott committed Sep 14, 2023
1 parent 0519eb1 commit 2c2e582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pmdas/haproxy/connect
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if config.has_section('pmda'):
sys.exit(1)

if len(sys.argv) > 1 and (sys.argv[1] == '-c' or sys.argv[1] == '--config'):
sys.stdout.write("user=%s\nsocket=%s\nurl=%s\n" % (user, skt, url.replace(";", "\;").replace("&", "\&")))
sys.stdout.write("user=%s\nsocket=%s\nurl=%s\n" % (user, skt, url.replace(";", "\\;").replace("&", "\\&")))
sys.exit(0)

try:
Expand Down

0 comments on commit 2c2e582

Please sign in to comment.