Skip to content

Commit

Permalink
fix(nginx_ansible): fix nginx validator
Browse files Browse the repository at this point in the history
  • Loading branch information
abolfazl8131 committed Nov 27, 2024
1 parent eaf713a commit cf4be88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/ansible_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AnsibleInstallNginx(BaseModel):

@validator("os")
def validator_os(cls, value):
if value not in ['ubuntu']:
raise ValueError("Size must be a valid string ending with 'Gi', 'Mi', or 'Ti'.")
valid_oss = ['ubuntu']
if value not in valid_oss:
raise ValueError(f"your selected OS must be in {valid_oss}")
return value
1 change: 1 addition & 0 deletions app/routes/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

@app.post("/ansible-install/nginx/")
async def ansible_install_generation_nginx(request:AnsibleInstallNginx) -> Output:

if os.environ.get("TEST"):
return Output(output='output')
generated_prompt = ansible_install_template(request,"nginx")
Expand Down

0 comments on commit cf4be88

Please sign in to comment.