]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Suggest create-zone after view-add-zone of a nonexisting zone. 15604/head
authorMiod Vallat <miod.vallat@powerdns.com>
Wed, 28 May 2025 06:20:49 +0000 (08:20 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Wed, 28 May 2025 06:55:44 +0000 (08:55 +0200)
pdns/pdnsutil.cc
regression-tests/tests/views-management/command

index 59bd7c371892aac706b834e502c0bc13985df67f..54a35f32bf9c44ac8ddb2265903e2964374ff436 100644 (file)
@@ -4624,7 +4624,14 @@ static int viewAddZone(vector<string>& cmds, const std::string_view synopsis)
   if (!B.viewAddZone(view, zone)) {
     cerr<<"Operation failed."<<endl;
     return 1;
- }
+  }
+  if (!g_quiet) {
+    DomainInfo info;
+    if (!B.getDomainInfo(zone, info)) {
+      cout << "Zone '" << zone << "' does not exist yet."<< endl;
+      cout << "Consider creating it with 'pdnsutil create-zone " << zone << "'" << endl;
+    }
+  }
   return 0;
 }
 
index 419547383f1fbe8a92e6307dfb30a60c648ca7fd..2b1ef149e98a6266d562b4433133c0b0956b7875 100755 (executable)
@@ -2,7 +2,7 @@
 set -o pipefail
 
 pdnsutil_wrapper() {
-$PDNSUTIL --config-dir=. --config-name=$backend $* 2>&1 | (egrep -v 'destructor' || true)
+$PDNSUTIL -q --config-dir=. --config-name=$backend $* 2>&1 | (egrep -v 'destructor' || true)
 }
 
 set -e # to make this first call exit us early for non-variant capable backends.