diff --git a/lemur/database.py b/lemur/database.py index 9198c9ce..13e67710 100644 --- a/lemur/database.py +++ b/lemur/database.py @@ -10,7 +10,7 @@ .. moduleauthor:: Kevin Glisson """ from inflection import underscore -from sqlalchemy import exc +from sqlalchemy import exc, func from sqlalchemy.sql import and_, or_ from sqlalchemy.orm import make_transient @@ -267,6 +267,12 @@ def clone(model): return model +def get_count(q): + count_q = q.statement.with_only_columns([func.count()]).order_by(None) + count = q.session.execute(count_q).scalar() + return count + + def sort_and_page(query, model, args): """ Helper that allows us to combine sorting and paging @@ -289,7 +295,7 @@ def sort_and_page(query, model, args): if sort_by and sort_dir: query = sort(query, model, sort_by, sort_dir) - total = query.count() + total = get_count(query) # offset calculated at zero page -= 1 diff --git a/lemur/plugins/lemur_acme/dyn.py b/lemur/plugins/lemur_acme/dyn.py index 3abf557f..50d69c3c 100644 --- a/lemur/plugins/lemur_acme/dyn.py +++ b/lemur/plugins/lemur_acme/dyn.py @@ -80,6 +80,7 @@ def delete_txt_record(change_id, account_number, domain, token): zone = Zone(zone_name) node = Node(zone_name, fqdn) + all_txt_records = node.get_all_records_by_type('TXT') for txt_record in all_txt_records: if txt_record.txtdata == ("{}".format(token)): diff --git a/lemur/static/app/angular/certificates/certificate/certificate.js b/lemur/static/app/angular/certificates/certificate/certificate.js index 1294dd32..abb3a4fa 100644 --- a/lemur/static/app/angular/certificates/certificate/certificate.js +++ b/lemur/static/app/angular/certificates/certificate/certificate.js @@ -258,6 +258,11 @@ angular.module('lemur') opened: false }; + CertificateService.getDnsProviders().then(function (providers) { + $scope.dnsProviders = providers; + } + ); + $scope.clearDates = function () { $scope.certificate.validityStart = null; $scope.certificate.validityEnd = null; diff --git a/lemur/static/app/angular/certificates/services.js b/lemur/static/app/angular/certificates/services.js index 61e4e45d..ecd7870f 100644 --- a/lemur/static/app/angular/certificates/services.js +++ b/lemur/static/app/angular/certificates/services.js @@ -243,6 +243,10 @@ angular.module('lemur') certificate.authority = defaults.authority; } } + + if (certificate.dnsProviderId) { + certificate.dnsProvider = {id: certificate.dnsProviderId}; + } }); }; diff --git a/requirements-dev.txt b/requirements-dev.txt index 113da73c..2d4c90a7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,20 +10,20 @@ certifi==2018.4.16 # via requests cfgv==1.0.0 # via pre-commit chardet==3.0.4 # via requests flake8==3.5.0 -identify==1.0.16 # via pre-commit +identify==1.0.18 # via pre-commit idna==2.6 # via requests invoke==1.0.0 mccabe==0.6.1 # via flake8 nodeenv==1.3.0 pkginfo==1.4.2 # via twine -pre-commit==1.8.2 +pre-commit==1.9.0 pycodestyle==2.3.1 # via flake8 pyflakes==1.6.0 # via flake8 pyyaml==3.12 # via aspy.yaml, pre-commit requests-toolbelt==0.8.0 # via twine requests==2.18.4 # via requests-toolbelt, twine six==1.11.0 # via cfgv, pre-commit -tqdm==4.23.3 # via twine +tqdm==4.23.4 # via twine twine==1.11.0 urllib3==1.22 # via requests -virtualenv==15.2.0 # via pre-commit +virtualenv==16.0.0 # via pre-commit diff --git a/requirements-docs.txt b/requirements-docs.txt index 2f3954bf..d760758b 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -15,8 +15,8 @@ asyncpool==1.0 babel==2.5.3 # via sphinx bcrypt==3.1.4 blinker==1.4 -boto3==1.7.19 -botocore==1.10.19 +boto3==1.7.21 +botocore==1.10.21 certifi==2018.4.16 cffi==1.11.5 click==6.7 @@ -54,7 +54,7 @@ mock==2.0.0 ndg-httpsclient==0.5.0 packaging==17.1 # via sphinx paramiko==2.4.1 -pbr==4.0.2 +pbr==4.0.3 pem==17.1.0 psycopg2==2.7.4 pyasn1-modules==0.2.1 diff --git a/requirements-tests.txt b/requirements-tests.txt index 70825609..301eca5b 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -5,11 +5,12 @@ # pip-compile --no-index --output-file requirements-tests.txt requirements-tests.in # asn1crypto==0.24.0 # via cryptography +atomicwrites==1.1.5 # via pytest attrs==18.1.0 # via pytest aws-xray-sdk==0.95 # via moto -boto3==1.7.21 # via moto +boto3==1.7.27 # via moto boto==2.48.0 # via moto -botocore==1.10.21 # via boto3, moto, s3transfer +botocore==1.10.27 # via boto3, moto, s3transfer certifi==2018.4.16 # via requests cffi==1.11.5 # via cryptography chardet==3.0.4 # via requests @@ -32,7 +33,7 @@ jsondiff==1.1.1 # via moto jsonpickle==0.9.6 # via aws-xray-sdk markupsafe==1.0 # via jinja2 mock==2.0.0 # via moto -more-itertools==4.1.0 # via pytest +more-itertools==4.2.0 # via pytest moto==1.3.3 nose==1.3.7 pbr==4.0.3 # via mock @@ -40,10 +41,10 @@ pluggy==0.6.0 # via pytest py==1.5.3 # via pytest pyaml==17.12.1 # via moto pycparser==2.18 # via cffi -pyflakes==1.6.0 +pyflakes==2.0.0 pytest-flask==0.10.0 pytest-mock==1.10.0 -pytest==3.5.1 +pytest==3.6.0 python-dateutil==2.6.1 # via botocore, faker, freezegun, moto pytz==2018.4 # via moto pyyaml==3.12 # via pyaml diff --git a/requirements.txt b/requirements.txt index 825b98bc..ef14a227 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,8 +13,8 @@ asn1crypto==0.24.0 # via cryptography asyncpool==1.0 bcrypt==3.1.4 # via flask-bcrypt, paramiko blinker==1.4 # via flask-mail, flask-principal, raven -boto3==1.7.21 -botocore==1.10.21 # via boto3, s3transfer +boto3==1.7.27 +botocore==1.10.27 # via boto3, s3transfer certifi==2018.4.16 cffi==1.11.5 # via bcrypt, cryptography, pynacl click==6.7 # via flask @@ -46,7 +46,7 @@ lockfile==0.12.2 mako==1.0.7 # via alembic markupsafe==1.0 # via jinja2, mako marshmallow-sqlalchemy==0.13.2 -marshmallow==2.15.2 +marshmallow==2.15.3 mock==2.0.0 # via acme ndg-httpsclient==0.5.0 paramiko==2.4.1 @@ -54,15 +54,15 @@ pbr==4.0.3 # via mock pem==17.1.0 psycopg2==2.7.4 pyasn1-modules==0.2.1 # via python-ldap -pyasn1==0.4.2 # via ndg-httpsclient, paramiko, pyasn1-modules, python-ldap, requests +pyasn1==0.4.3 # via ndg-httpsclient, paramiko, pyasn1-modules, python-ldap, requests pycparser==2.18 # via cffi -pyjwt==1.6.1 +pyjwt==1.6.4 pynacl==1.2.1 # via paramiko pyopenssl==17.2.0 pyrfc3339==1.0 # via acme python-dateutil==2.7.3 # via alembic, arrow, botocore python-editor==1.0.3 # via alembic -python-ldap==3.0.0 +python-ldap==3.1.0 pytz==2018.4 # via acme, flask-restful, pyrfc3339 pyyaml==3.12 # via cloudflare raven[flask]==6.8.0