Skip to content

Commit

Permalink
Update PgLOG.py for convert_chars()
Browse files Browse the repository at this point in the history
  • Loading branch information
zaihuaji authored Jan 9, 2025
1 parent a9f3fc5 commit 48c5de9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -1511,13 +1511,13 @@ def check_process_host(hosts, chost = None, mflag = None, pinfo = None, logact =
#
# convert special characters
#
def convert_chars(name, default = None):
def convert_chars(name, default = 'X'):

if not name: return default
if re.match(r'^[a-zA-Z0-9]+$', name): return name # no need convert

if not name or re.match(r'^[a-zA-Z0-9]+$', name): return name # no need convert

z = ord('z')
newchrs = ochrs = ''
if default == None: default = name
for i in range(len(name)):
ch = name[i]
if re.match(r'^[a-zA-Z0-9]$', ch):
Expand Down

0 comments on commit 48c5de9

Please sign in to comment.