mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Merge pull request #375 from github/weight-0-16
Drop dynamic record value weight to 0-16
This commit is contained in:
@@ -514,7 +514,7 @@ class _DynamicMixin(object):
|
||||
try:
|
||||
weight = value['weight']
|
||||
weight = int(weight)
|
||||
if weight < 1 or weight > 255:
|
||||
if weight < 1 or weight > 15:
|
||||
reasons.append('invalid weight "{}" in pool "{}" '
|
||||
'value {}'.format(weight, _id,
|
||||
value_num))
|
||||
|
||||
@@ -19,7 +19,7 @@ a:
|
||||
- value: 6.6.6.6
|
||||
weight: 10
|
||||
- value: 5.5.5.5
|
||||
weight: 25
|
||||
weight: 15
|
||||
rules:
|
||||
- geos:
|
||||
- EU-GB
|
||||
@@ -90,9 +90,9 @@ cname:
|
||||
sea:
|
||||
values:
|
||||
- value: target-sea-1.unit.tests.
|
||||
weight: 100
|
||||
weight: 10
|
||||
- value: target-sea-2.unit.tests.
|
||||
weight: 175
|
||||
weight: 14
|
||||
rules:
|
||||
- geos:
|
||||
- EU-GB
|
||||
|
||||
@@ -23,7 +23,7 @@ a:
|
||||
fallback: null
|
||||
values:
|
||||
- value: 5.5.5.5
|
||||
weight: 25
|
||||
weight: 15
|
||||
- value: 6.6.6.6
|
||||
weight: 10
|
||||
rules:
|
||||
|
||||
@@ -21,9 +21,9 @@ cname:
|
||||
fallback: null
|
||||
values:
|
||||
- value: target-sea-1.unit.tests.
|
||||
weight: 100
|
||||
weight: 10
|
||||
- value: target-sea-2.unit.tests.
|
||||
weight: 175
|
||||
weight: 14
|
||||
rules:
|
||||
- geos:
|
||||
- EU-GB
|
||||
|
||||
@@ -2460,7 +2460,7 @@ class TestDynamicRecords(TestCase):
|
||||
'weight': 1,
|
||||
'value': '6.6.6.6',
|
||||
}, {
|
||||
'weight': 256,
|
||||
'weight': 16,
|
||||
'value': '7.7.7.7',
|
||||
}],
|
||||
},
|
||||
@@ -2484,7 +2484,7 @@ class TestDynamicRecords(TestCase):
|
||||
}
|
||||
with self.assertRaises(ValidationError) as ctx:
|
||||
Record.new(self.zone, 'bad', a_data)
|
||||
self.assertEquals(['invalid weight "256" in pool "three" value 2'],
|
||||
self.assertEquals(['invalid weight "16" in pool "three" value 2'],
|
||||
ctx.exception.reasons)
|
||||
|
||||
# invalid non-int weight
|
||||
|
||||
Reference in New Issue
Block a user