Skip to content

Commit cf4be88

Browse files
committed
fix(nginx_ansible): fix nginx validator
1 parent eaf713a commit cf4be88

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/models/ansible_models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class AnsibleInstallNginx(BaseModel):
1010

1111
@validator("os")
1212
def validator_os(cls, value):
13-
if value not in ['ubuntu']:
14-
raise ValueError("Size must be a valid string ending with 'Gi', 'Mi', or 'Ti'.")
13+
valid_oss = ['ubuntu']
14+
if value not in valid_oss:
15+
raise ValueError(f"your selected OS must be in {valid_oss}")
1516
return value

app/routes/ansible.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
@app.post("/ansible-install/nginx/")
99
async def ansible_install_generation_nginx(request:AnsibleInstallNginx) -> Output:
10+
1011
if os.environ.get("TEST"):
1112
return Output(output='output')
1213
generated_prompt = ansible_install_template(request,"nginx")

0 commit comments

Comments
 (0)