Skip to content

Commit

Permalink
fix typo and clarify docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Feb 17, 2025
1 parent 869a340 commit bd2f4a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/middlewared/middlewared/api/v25_10_0/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ class SmbServiceEntry(BaseModel):
@field_validator('bindip')
@classmethod
def normalize_bindips(cls, values: list[IPvAnyInterface]) -> list[str]:
"""We'll be passed a list of IPv4AnyInterface types, and we
"""We'll be passed a list of IPvAnyInterface types, and we
deserialize these values by simply doing `str(value)`. Since this
is an `Interface` type from `ipaddress` module, it will contain
the netmask in the string (i.e. '192.168.1.150/32'). We don't
need the netmask info, so this simply removes it."""
need the netmask info because the smb.bindip_choices method
returns a dictionary of addresses without the netmask info.
(i.e. {'192.168.1.150': '192.168.1.150'})."""
return [str(i.ip) for i in values]


Expand Down

0 comments on commit bd2f4a2

Please sign in to comment.