Skip to content

Commit e16021d

Browse files
author
Ziqun Ye
committed
update the code based on comments
1 parent 8535ef1 commit e16021d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ads/opctl/conda/cmds.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,10 @@ def _publish(
638638
)
639639
except Exception:
640640
raise RuntimeError(f"Could not pack environment {conda_slug}.")
641-
if "/" in conda_slug:
642-
raise ValueError("Invalid conda_slug. found `/` in slug name. Please use a different slug name.")
641+
NOT_ALLOWED_CHARS = "@#$%^&*/"
642+
643+
if any(chr in conda_slug for chr in NOT_ALLOWED_CHARS):
644+
raise ValueError(f"Invalid conda_slug. Found {NOT_ALLOWED_CHARS} in slug name. Please use a different slug name.")
643645
pack_file = os.path.join(pack_folder_path, f"{conda_slug}.tar.gz")
644646
if not os.path.exists(pack_file):
645647
raise RuntimeError(f"Pack {pack_file} was not created.")

0 commit comments

Comments
 (0)