mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Merge branch 'master' into update-gitignore
This commit is contained in:
@@ -174,6 +174,6 @@ In the above example each name had a single record, but there are cases where a
|
||||
|
||||
### Record data
|
||||
|
||||
Each record type has a corresponding set of required data. The easiest way to determine what's required is probably to look at the record object in [`octodns/record.py`](/octodns/record.py). You may also utilize `octodns-validate` which will throw errors about what's missing when run.
|
||||
Each record type has a corresponding set of required data. The easiest way to determine what's required is probably to look at the record object in [`octodns/record/__init__.py`](/octodns/record/__init__.py). You may also utilize `octodns-validate` which will throw errors about what's missing when run.
|
||||
|
||||
`type` is required for all records. `ttl` is optional. When TTL is not specified the `YamlProvider`'s default will be used. In any situation where an array of `values` can be used you can opt to go with `value` as a single item if there's only one.
|
||||
|
||||
@@ -714,6 +714,8 @@ class _TargetValue(object):
|
||||
|
||||
@classmethod
|
||||
def process(self, value):
|
||||
if value:
|
||||
return value.lower()
|
||||
return value
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname $0)"/..
|
||||
cd "$(dirname "$0")"/..
|
||||
ROOT=$(pwd)
|
||||
|
||||
if [ -z "$VENV_NAME" ]; then
|
||||
@@ -13,9 +13,9 @@ fi
|
||||
|
||||
if [ ! -d "$VENV_NAME" ]; then
|
||||
if [ -z "$VENV_PYTHON" ]; then
|
||||
VENV_PYTHON=`which python`
|
||||
VENV_PYTHON=$(command -v python)
|
||||
fi
|
||||
virtualenv --python=$VENV_PYTHON $VENV_NAME
|
||||
virtualenv --python="$VENV_PYTHON" "$VENV_NAME"
|
||||
fi
|
||||
. "$VENV_NAME/bin/activate"
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ export DYN_PASSWORD=
|
||||
export DYN_USERNAME=
|
||||
export GOOGLE_APPLICATION_CREDENTIALS=
|
||||
|
||||
coverage run --branch --source=octodns --omit=octodns/cmds/* `which nosetests` --with-xunit "$@"
|
||||
coverage run --branch --source=octodns --omit=octodns/cmds/* "$(command -v nosetests)" --with-xunit "$@"
|
||||
coverage html
|
||||
coverage xml
|
||||
coverage report
|
||||
coverage report | grep ^TOTAL| grep -qv 100% && {
|
||||
echo "Incomplete code coverage"
|
||||
coverage report | grep ^TOTAL | grep -qv 100% && {
|
||||
echo "Incomplete code coverage" >&2
|
||||
exit 1
|
||||
} || echo "Code coverage 100%"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname $0)"/..
|
||||
cd "$(dirname "$0")"/..
|
||||
ROOT=$(pwd)
|
||||
|
||||
if [ -z "$VENV_NAME" ]; then
|
||||
@@ -16,10 +16,10 @@ if [ ! -f "$ACTIVATE" ]; then
|
||||
fi
|
||||
. "$ACTIVATE"
|
||||
|
||||
VERSION=$(grep __VERSION__ $ROOT/octodns/__init__.py | sed -e "s/.* = '//" -e "s/'$//")
|
||||
VERSION="$(grep __VERSION__ "$ROOT/octodns/__init__.py" | sed -e "s/.* = '//" -e "s/'$//")"
|
||||
|
||||
git tag -s v$VERSION -m "Release $VERSION"
|
||||
git push origin v$VERSION
|
||||
git tag -s "v$VERSION" -m "Release $VERSION"
|
||||
git push origin "v$VERSION"
|
||||
echo "Tagged and pushed v$VERSION"
|
||||
python setup.py sdist
|
||||
twine upload dist/*$VERSION.tar.gz
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
set -e
|
||||
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
echo "Changes in local directory, commit or clear"
|
||||
echo "Changes in local directory, commit or clear" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SHA=$(git rev-parse HEAD)
|
||||
python setup.py sdist
|
||||
TARBALL=dist/octodns-$SHA.tar.gz
|
||||
mv dist/octodns-0.*.tar.gz $TARBALL
|
||||
TARBALL="dist/octodns-$SHA.tar.gz"
|
||||
mv dist/octodns-0.*.tar.gz "$TARBALL"
|
||||
|
||||
echo "Created $TARBALL"
|
||||
|
||||
@@ -8,8 +8,8 @@ from __future__ import absolute_import, division, print_function, \
|
||||
from unittest import TestCase
|
||||
|
||||
from octodns.record import ARecord, AaaaRecord, AliasRecord, CaaRecord, \
|
||||
CnameRecord, Create, Delete, GeoValue, MxRecord, NaptrRecord, \
|
||||
NaptrValue, NsRecord, Record, SshfpRecord, SpfRecord, SrvRecord, \
|
||||
CnameRecord, Create, Delete, GeoValue, MxRecord, NaptrRecord, NaptrValue, \
|
||||
NsRecord, PtrRecord, Record, SshfpRecord, SpfRecord, SrvRecord, \
|
||||
TxtRecord, Update, ValidationError, _Dynamic, _DynamicPool, _DynamicRule
|
||||
from octodns.zone import Zone
|
||||
|
||||
@@ -27,6 +27,45 @@ class TestRecord(TestCase):
|
||||
})
|
||||
self.assertEquals('mixedcase', record.name)
|
||||
|
||||
def test_alias_lowering_value(self):
|
||||
upper_record = AliasRecord(self.zone, 'aliasUppwerValue', {
|
||||
'ttl': 30,
|
||||
'type': 'ALIAS',
|
||||
'value': 'GITHUB.COM',
|
||||
})
|
||||
lower_record = AliasRecord(self.zone, 'aliasLowerValue', {
|
||||
'ttl': 30,
|
||||
'type': 'ALIAS',
|
||||
'value': 'github.com',
|
||||
})
|
||||
self.assertEquals(upper_record.value, lower_record.value)
|
||||
|
||||
def test_cname_lowering_value(self):
|
||||
upper_record = CnameRecord(self.zone, 'CnameUppwerValue', {
|
||||
'ttl': 30,
|
||||
'type': 'CNAME',
|
||||
'value': 'GITHUB.COM',
|
||||
})
|
||||
lower_record = CnameRecord(self.zone, 'CnameLowerValue', {
|
||||
'ttl': 30,
|
||||
'type': 'CNAME',
|
||||
'value': 'github.com',
|
||||
})
|
||||
self.assertEquals(upper_record.value, lower_record.value)
|
||||
|
||||
def test_ptr_lowering_value(self):
|
||||
upper_record = PtrRecord(self.zone, 'PtrUppwerValue', {
|
||||
'ttl': 30,
|
||||
'type': 'PTR',
|
||||
'value': 'GITHUB.COM',
|
||||
})
|
||||
lower_record = PtrRecord(self.zone, 'PtrLowerValue', {
|
||||
'ttl': 30,
|
||||
'type': 'PTR',
|
||||
'value': 'github.com',
|
||||
})
|
||||
self.assertEquals(upper_record.value, lower_record.value)
|
||||
|
||||
def test_a_and_record(self):
|
||||
a_values = ['1.2.3.4', '2.2.3.4']
|
||||
a_data = {'ttl': 30, 'values': a_values}
|
||||
|
||||
Reference in New Issue
Block a user