REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 1.65 KB
Close
/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/public_hooks/bin/post_modify_package.py
Text
Base64
#!/opt/cloudlinux/venv/bin/python3 -bb # -*- coding: utf-8 -*- # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2022 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT # """ Package POST modification hook. This script must be called AFTER different package-related changes in control panel. See --help and docs for detailed description of actions and parameters. """ import argparse import re import sys from clcommon.public_hooks.lib import ModifyPackageHook from clcommon.public_hooks import setup_logger_and_sentry _VALID_PACKAGE_NAME_RE = re.compile(r'^[a-zA-Z0-9._-]{1,255}$') def _validate_package_name(value, option_name): if value is not None and not _VALID_PACKAGE_NAME_RE.fullmatch(value): print(f"Error: invalid value for {option_name}: {value!r}", file=sys.stderr) sys.exit(1) if __name__ == '__main__': setup_logger_and_sentry() parser = argparse.ArgumentParser(description=__doc__) subparsers = parser.add_subparsers(dest='command') rename = subparsers.add_parser('rename') rename.add_argument('--name', required=True, help='Name of the package') rename.add_argument('--new-name', required=False, help='Package after rename') args = parser.parse_args() listener = ModifyPackageHook() if args.command == 'rename': _validate_package_name(args.name, '--name') _validate_package_name(args.new_name, '--new-name') listener.post_modify_package( args.name, new_name=args.new_name, ) else: raise NotImplementedError
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-06-23 06:30:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
post_modify_admin.py
1.42 KB
lrwxr-xr-x
2026-06-03 13:38:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
post_modify_domain.py
6.10 KB
lrwxr-xr-x
2026-06-03 13:38:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
post_modify_package.py
1.65 KB
lrwxr-xr-x
2026-06-03 13:38:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
post_modify_user.py
3.56 KB
lrwxr-xr-x
2026-06-03 13:38:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pre_modify_user.py
1.24 KB
lrwxr-xr-x
2026-06-03 13:38:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).