Merge "Fix networks validation for Trove"

This commit is contained in:
Zuul 2024-05-11 10:20:19 +00:00 committed by Gerrit Code Review
commit 3799d1cca3
2 changed files with 2 additions and 3 deletions

View File

@ -365,8 +365,7 @@ class TroveCluster(resource.Resource):
% self.PORT)
raise exception.StackValidationFailed(message=msg)
if (bool(nic.get(self.NET) is not None) ==
bool(nic.get(self.PORT) is not None)):
if (nic.get(self.NET) is None) == (nic.get(self.PORT) is None):
msg = (_("Either %(net)s or %(port)s must be provided.")
% {'net': self.NET, 'port': self.PORT})
raise exception.StackValidationFailed(message=msg)

View File

@ -685,7 +685,7 @@ class Instance(resource.Resource):
msg = _("Can not use %s property on Nova-network.") % self.PORT
raise exception.StackValidationFailed(message=msg)
if bool(nic.get(self.NET)) == bool(nic.get(self.PORT)):
if (nic.get(self.NET) is None) == (nic.get(self.PORT) is None):
msg = _("Either %(net)s or %(port)s must be provided.") % {
'net': self.NET, 'port': self.PORT}
raise exception.StackValidationFailed(message=msg)