Open cohoe opened 11 years ago
would this fix it then?
diff --git a/API/plperl.sql b/API/plperl.sql
index 2c59205..be1a35f 100644
--- a/API/plperl.sql
+++ b/API/plperl.sql
@@ -267,8 +267,8 @@ CREATE OR REPLACE FUNCTION "api"."generate_dhcpd_config"() RETURNS VOID AS $$
$output .= " ddns-domainname \"$zone\";\n" if (defined($zone));
$output .= " option domain-name \"$zone\";\n" if (defined($zone));
$output .= "}\n";
- $output .= "subclass \"$class\" 1:$mac;\n";
- $output .= "subclass \"$class\" $mac;\n\n";
+ $output .= "subclass \"$class\" 1:$mac;\n" if ($class != null);
+ $output .= "subclass \"$class\" $mac;\n\n" if ($class != null);
return $output;
}
Or is this better:
diff --git a/API/plperl.sql b/API/plperl.sql
index 2c59205..d1bbb99 100644
--- a/API/plperl.sql
+++ b/API/plperl.sql
@@ -267,8 +267,8 @@ CREATE OR REPLACE FUNCTION "api"."generate_dhcpd_config"() RETURNS VOID AS $$
$output .= " ddns-domainname \"$zone\";\n" if (defined($zone));
$output .= " option domain-name \"$zone\";\n" if (defined($zone));
$output .= "}\n";
- $output .= "subclass \"$class\" 1:$mac;\n";
- $output .= "subclass \"$class\" $mac;\n\n";
+ $output .= "subclass \"$class\" 1:$mac;\n" if (defined($class));
+ $output .= "subclass \"$class\" $mac;\n\n" if (defined($class));
return $output;
}
Bump
The problem is that I don't remember if there are other dependencies on DHCP classes. This hasn't been enough of a priority to look at.
systems.interface_addresses.class needs to be NULL-able
@agargiulo: for dhcpgen, if(address.class is null) then (skip "subclass" lines for address)