Skip to content

Commit 577681e

Browse files
caladdbsanders
authored andcommitted
BUGFIX: Fix SQL error in list attr
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.
1 parent 23bb341 commit 577681e

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

  • common/src/stack/command/stack/commands/list/attr

common/src/stack/command/stack/commands/list/attr/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ def addGlobalAttrs(self, attributes):
4848

4949
for (ip, host, subnet, netmask) in self.db.select(
5050
"""
51-
n.ip, if (n.name <> NULL, n.name, nd.name),
52-
s.address, s.mask from
53-
networks n, appliances a, subnets s, nodes nd
54-
where
55-
n.node=nd.id and nd.appliance=a.id and
56-
a.name='frontend' and n.subnet=s.id and
51+
n.ip, if (n.name IS NOT NULL, n.name, nd.name),
52+
s.address, s.mask from
53+
networks n, appliances a, subnets s, nodes nd
54+
where
55+
n.node=nd.id and nd.appliance=a.id and
56+
a.name='frontend' and n.subnet=s.id and
5757
s.name='private'
5858
"""):
5959
readonly['Kickstart_PrivateKickstartHost'] = ip
@@ -64,12 +64,12 @@ def addGlobalAttrs(self, attributes):
6464

6565
for (ip, host, zone, subnet, netmask) in self.db.select(
6666
"""
67-
n.ip, if (n.name <> NULL, n.name, nd.name),
68-
s.zone, s.address, s.mask from
69-
networks n, appliances a, subnets s, nodes nd
70-
where
67+
n.ip, if (n.name IS NOT NULL, n.name, nd.name),
68+
s.zone, s.address, s.mask from
69+
networks n, appliances a, subnets s, nodes nd
70+
where
7171
n.node=nd.id and nd.appliance=a.id and
72-
a.name='frontend' and n.subnet=s.id and
72+
a.name='frontend' and n.subnet=s.id and
7373
s.name='public'
7474
"""):
7575
readonly['Kickstart_PublicAddress'] = ip

0 commit comments

Comments
 (0)