Przeglądaj źródła

fixed error detection for tsig key

tags/v2.0.0
Robin Thoni 7 lat temu
rodzic
commit
9f3b9519f1
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2
    1
      init.py

+ 2
- 1
init.py Wyświetl plik

@@ -52,7 +52,7 @@ def add_tsig_key_to_zone(container, zone, key_name):
52 52
     out = container.exec_run(['pdnsutil', 'set-meta', zone, 'TSIG-ALLOW-DNSUPDATE', key_name])
53 53
     if out is not None:
54 54
         out = out.decode('UTF-8')
55
-        return out == 'Enabled TSIG key %s for %s\n' % (key_name, zone) # might to strict, but as we can not get return code
55
+        return out == 'Set \'%s\' meta TSIG-ALLOW-DNSUPDATE = %s\n' % (zone, key_name) # might to strict, but as we can not get return code
56 56
     return False
57 57
 
58 58
 def main():
@@ -127,6 +127,7 @@ def main():
127 127
             print('Adding TSIG %s to zone %s...' % (args.tsig_key_name, zone))
128 128
             if not add_tsig_key_to_zone(container, zone, args.tsig_key_name):
129 129
                 print('Failed to add TSIG key to zone: Unknown error')
130
+                return 8
130 131
 
131 132
     print('DHCP_TSIG_KEY_NAME=%s' % (args.tsig_key_name))
132 133
     print('DHCP_TSIG_KEY_ALGO=%s' % (args.tsig_key_algo))

Ładowanie…
Anuluj
Zapisz