<%-
if @is_dynamic and (@allow_update.empty? and @allow_update_cidr.empty?)
  raise(Puppet::ParseError, "Both allow_update and allow_update_cidr are empty for dynamic zone '#{name}'")
end
-%>
# File managed by puppet
zone "<%= @name %>" IN {
  type master;
<% if @is_dynamic -%>
  file "<%= scope.lookupvar("bind::params::dynamic_directory") %>/<%= @name %>.conf";
<% else -%>
  file "<%= scope.lookupvar("bind::params::pri_directory") %>/<%= @name %>.conf";
<% end -%>
<% if @zone_xfers and not @zone_xfers.empty? -%>
  allow-transfer { <%= Array(@zone_xfers).join('; ') -%>; };
<% else -%>
  allow-transfer { none; };
<% end -%>
<% if @is_dynamic -%>
  allow-update { <% if ![nil, '', :undef].include?(@allow_update) -%>key <%= Array(@allow_update).join('.; key ') -%>.;<% end
    -%><% if ![nil, '', :undef].include?(@allow_update_cidr) -%> <%= Array(@allow_update_cidr).join('; ') -%>;<% end -%> };
<% end -%>
  allow-query { any; };
  notify yes;
<% if @zone_notify and not @zone_notify.empty? -%>
  also-notify { <%= Array(@zone_notify).join('; ') -%>; };
<% end -%>
};

<%-
if @is_dynamic and (@allow_update.empty? and @allow_update_cidr.empty?)
  raise(Puppet::ParseError, "Both allow_update and allow_update_cidr are empty for dynamic zone '#{name}'")
end
-%>
# File managed by puppet
zone "<%= @name %>" IN {
  type master;
<% if @is_dynamic -%>
  file "<%= scope.lookupvar("bind::params::dynamic_directory") %>/<%= @name %>.conf";
<% else -%>
  file "<%= scope.lookupvar("bind::params::pri_directory") %>/<%= @name %>.conf";
<% end -%>
<% if @zone_xfers and not @zone_xfers.empty? -%>
  allow-transfer { <%= Array(@zone_xfers).join('; ') -%>; };
<% else -%>
  allow-transfer { none; };
<% end -%>
<% if @is_dynamic -%>
  allow-update { <% if @allow_update.empty? -%>key <%= Array(@allow_update).join('.; key ') -%>.;<% end
    -%><% if @allow_update_cidr.empty? -%> <%= Array(@allow_update_cidr).join('; ') -%>;<% end -%> };
<% end -%>
  allow-query { any; };
  notify yes;
<% if @zone_notify and not @zone_notify.empty? -%>
  also-notify { <%= Array(@zone_notify).join('; ') -%>; };
<% end -%>
};

Use empty method to check arrays
Use empty method to check arrays
