Skip to content

Commit

Permalink
http poller fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amyasnikov committed Feb 27, 2024
1 parent 97810ce commit ee00199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion validity/pollers/default_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ScrapliNeconfPrivateCreds(BaseModel):


class RequestsPublicCreds(BaseModel):
url: str = "https://{{device.primary_ip}}/{{command.parameters.url_path.lstrip('/')}}"
url: str = "https://{{device.primary_ip.address.ip}}/{{command.parameters.url_path.lstrip('/')}}"


class ConnectionTypeCredentials(BaseModel):
Expand Down
5 changes: 4 additions & 1 deletion validity/pollers/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@


class RequestParams(BaseModel, extra="allow"):
url: str = Field("https://{{device.primary_ip}}/{{command.parameters.url_path.lstrip('/')}}", exclude=True)
url: str = Field(
"https://{{device.primary_ip.address.ip}}/{{command.parameters.url_path.lstrip('/')}}", exclude=True
)
verify: bool | str = False
auth: tuple[str, ...] | None = None

def rendered_url(self, device: "Device", command: "Command") -> str:
return Environment().from_string(self.url).render(device=device, command=command)
Expand Down

0 comments on commit ee00199

Please sign in to comment.