Shuffle of the order of BIND9 masters

Make sure that the masters given to BIND9 on an addzone are shuffled
so that different MiniDNS instances are targetted for AXFRs for different
zones

Change-Id: Id01815f8d70fa50e83f0c6bee52894b885788e49
Closes-Bug: 1444414
This commit is contained in:
Tim Simmons 2015-04-15 20:28:18 +00:00
parent ed816e366a
commit 50d73a94dc

View File

@ -13,6 +13,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import random
from oslo_log import log as logging
from designate import exceptions
@ -42,6 +44,10 @@ class Bind9Backend(base.Backend):
host = master['host']
port = master['port']
masters.append('%s port %s' % (host, port))
# Ensure different MiniDNS instances are targetted for AXFRs
random.shuffle(masters)
rndc_op = [
'addzone',
'%s { type slave; masters { %s;}; file "slave.%s%s"; };' %