Skip to content

Commit

Permalink
BUGFIX: Fix SQL error in list attr
Browse files Browse the repository at this point in the history
In the `addGlobalAttrs` function used to generate `Kickstart_PrivateHostname` and `Kickstart_PublicHostname` contained an SQL statement testing if the network interface name was null, using `<>`. This will always return false, no matter what, and should have been `IS NOT NULL` instead.
  • Loading branch information
caladd authored and bsanders committed Jun 5, 2019
1 parent 23bb341 commit 577681e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions common/src/stack/command/stack/commands/list/attr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def addGlobalAttrs(self, attributes):

for (ip, host, subnet, netmask) in self.db.select(
"""
n.ip, if (n.name <> NULL, n.name, nd.name),
s.address, s.mask from
networks n, appliances a, subnets s, nodes nd
where
n.node=nd.id and nd.appliance=a.id and
a.name='frontend' and n.subnet=s.id and
n.ip, if (n.name IS NOT NULL, n.name, nd.name),
s.address, s.mask from
networks n, appliances a, subnets s, nodes nd
where
n.node=nd.id and nd.appliance=a.id and
a.name='frontend' and n.subnet=s.id and
s.name='private'
"""):
readonly['Kickstart_PrivateKickstartHost'] = ip
Expand All @@ -64,12 +64,12 @@ def addGlobalAttrs(self, attributes):

for (ip, host, zone, subnet, netmask) in self.db.select(
"""
n.ip, if (n.name <> NULL, n.name, nd.name),
s.zone, s.address, s.mask from
networks n, appliances a, subnets s, nodes nd
where
n.ip, if (n.name IS NOT NULL, n.name, nd.name),
s.zone, s.address, s.mask from
networks n, appliances a, subnets s, nodes nd
where
n.node=nd.id and nd.appliance=a.id and
a.name='frontend' and n.subnet=s.id and
a.name='frontend' and n.subnet=s.id and
s.name='public'
"""):
readonly['Kickstart_PublicAddress'] = ip
Expand Down

0 comments on commit 577681e

Please sign in to comment.