if you touch it, then I think that simple `case` is better here like
```
case policy
when :custom
  DnsServer.SetNetconfigDNSPolicy(UI.QueryWidget(Id("custom_policy"), :Value))
when :auto
  DnsServer.SetNetconfigDNSPolicy("auto")
when :static
  DnsServer.SetNetconfigDNSPolicy("STATIC")
else
  DnsServer.SetNetconfigDNSPolicy("")
end
```

and maybe you can also see that there is bunch of repetition of `DnsServer.SetNetconfigDNSPolicy` so you can reduce it with
```
dns_policy = case policy
  when :custom then UI.QueryWidget(Id("custom_policy"), :Value)
  when :auto     then "auto"
  when :static   then "static
  else                      ""
end
```