Skip to content

Commit

Permalink
Fix for validate_refs that says hosts are not valid if they are an em…
Browse files Browse the repository at this point in the history
…pty object
  • Loading branch information
arlake228 committed Jun 21, 2024
1 parent 09aeb74 commit 1e52c4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,9 @@ def _validate_urlhostport(self, val=None):
return False

def _has_field(self, parent, field):
return parent.get(field)
if parent.get(field) is None:
return False
return True

def _init_field(self, parent, field):
if not self._has_field(parent, field):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def validate_refs(self):
host_ref = address.host_ref()
context_refs = address.context_refs()
#check host ref
if host_ref and not self.host(host_ref):
if host_ref and self.host(host_ref) is None:
ref_errors.append("Address {} references a host object {} that does not exist.".format(addr_name, host_ref))

#check context refs
Expand Down

0 comments on commit 1e52c4c

Please sign in to comment.