mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Simplify getZones.go
This commit is contained in:
@@ -172,7 +172,7 @@ func GetZone(args GetZoneArgs) error {
|
|||||||
if len(args.ZoneNames) == 1 && args.ZoneNames[0] == "all" {
|
if len(args.ZoneNames) == 1 && args.ZoneNames[0] == "all" {
|
||||||
lister, ok := provider.(providers.ZoneLister)
|
lister, ok := provider.(providers.ZoneLister)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("provider type %s:%s cannot list zones to use the \"all\" feature", args.CredName, args.ProviderName)
|
return fmt.Errorf("provider type %s:%s cannot list zones to use the 'all' feature", args.CredName, args.ProviderName)
|
||||||
}
|
}
|
||||||
zones, err = lister.ListZones()
|
zones, err = lister.ListZones()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -351,7 +351,7 @@ func formatDsl(zonename string, rec *models.RecordConfig, defaultTTL uint32) str
|
|||||||
case "TLSA":
|
case "TLSA":
|
||||||
target = fmt.Sprintf(`%d, %d, %d, "%s"`, rec.TlsaUsage, rec.TlsaSelector, rec.TlsaMatchingType, rec.GetTargetField())
|
target = fmt.Sprintf(`%d, %d, %d, "%s"`, rec.TlsaUsage, rec.TlsaSelector, rec.TlsaMatchingType, rec.GetTargetField())
|
||||||
case "TXT":
|
case "TXT":
|
||||||
target = jsonQuoted(rec.GetTargetField())
|
target = jsonQuoted(rec.GetTargetTXTJoined())
|
||||||
// TODO(tlim): If this is an SPF record, generate a SPF_BUILDER().
|
// TODO(tlim): If this is an SPF record, generate a SPF_BUILDER().
|
||||||
case "NS":
|
case "NS":
|
||||||
// NS records at the apex should be NAMESERVER() records.
|
// NS records at the apex should be NAMESERVER() records.
|
||||||
|
|||||||
Reference in New Issue
Block a user