Skip to content

Commit

Permalink
Remove Python3 octal format from supported types
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-enoent authored and tom95858 committed Dec 22, 2024
1 parent c8d6b2f commit 9c18084
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ldms/man/ldmsd_yaml_parser.man
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ A unit string is one of the followings:
.PP
Permissions are defined in a unix-like permissions format, with a dash indicating a lack of permission. Executable permisson is not supported by "perm" and should always be "-". e.g. "rw-r-----"
.br
A string of an octal number is also accepted. e.g. "0640"
A string of an octal number is also accepted. e.g. "0640".
.br
"r" represents read permissions.
.br
Expand Down
6 changes: 3 additions & 3 deletions ldms/python/ldmsd/parser_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ def perm_handler(perm_str):
except:
raise ValueError(f'Error: permission string \"{perm_str}\" is not a valid octal')
else:
raise ValueError(f'Error: YAML permisson string "{perm_str}"\n'
f'Must represent either a valid octal number, or a use unix-like vernacular\n'
raise ValueError(f'Error: YAML permisson string "{perm_str} is not a valid octal"\n'
f'Must represent either a valid octal number, or use unix-like vernacular\n'
f'Allowed format: (r|-)(w|-)-(r|-)(w|-)-(r|-)(w|-)-')

return '0'+oct(perms)[2:]
perm_handler.string_pattern = re.compile('(?:(r)|-)(?:(w)|-)-(?:(r)|-)(?:(w)|-)-(?:(r)|-)(?:(w)|-)-')
perm_handler.octal_pattern = re.compile('(0|0o)?[0-7]{1,3}')
perm_handler.octal_pattern = re.compile('^0?[0-7]{1,3}')

class YamlCfg(object):
def build_daemons(self, config):
Expand Down

0 comments on commit 9c18084

Please sign in to comment.