Skip to content

Commit

Permalink
update the code based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
z7ye committed Nov 2, 2023
1 parent 8535ef1 commit e16021d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ads/opctl/conda/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,10 @@ def _publish(
)
except Exception:
raise RuntimeError(f"Could not pack environment {conda_slug}.")
if "/" in conda_slug:
raise ValueError("Invalid conda_slug. found `/` in slug name. Please use a different slug name.")
NOT_ALLOWED_CHARS = "@#$%^&*/"

if any(chr in conda_slug for chr in NOT_ALLOWED_CHARS):
raise ValueError(f"Invalid conda_slug. Found {NOT_ALLOWED_CHARS} in slug name. Please use a different slug name.")
pack_file = os.path.join(pack_folder_path, f"{conda_slug}.tar.gz")
if not os.path.exists(pack_file):
raise RuntimeError(f"Pack {pack_file} was not created.")
Expand Down

0 comments on commit e16021d

Please sign in to comment.