Rename sync-all to the more accurate "sync-domains"
Change-Id: I7d89d5cb6e02b237396987c179583b64213bba78
This commit is contained in:
parent
4072f43370
commit
cd9e279779
|
@ -34,7 +34,7 @@
|
||||||
"use_blacklisted_domain": "rule:admin",
|
"use_blacklisted_domain": "rule:admin",
|
||||||
|
|
||||||
"diagnostics_ping": "rule:admin",
|
"diagnostics_ping": "rule:admin",
|
||||||
"diagnostics_sync_all": "rule:admin",
|
"diagnostics_sync_domains": "rule:admin",
|
||||||
"diagnostics_sync_domain": "rule:admin",
|
"diagnostics_sync_domain": "rule:admin",
|
||||||
"diagnostics_sync_record": "rule:admin"
|
"diagnostics_sync_record": "rule:admin"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,12 @@ LOG = logging.getLogger(__name__)
|
||||||
blueprint = flask.Blueprint('sync', __name__)
|
blueprint = flask.Blueprint('sync', __name__)
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route('/sync', methods=['POST'])
|
@blueprint.route('/domains/sync', methods=['POST'])
|
||||||
def sync_all():
|
def sync_domains():
|
||||||
context = flask.request.environ.get('context')
|
context = flask.request.environ.get('context')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
central_api.sync_all(context)
|
central_api.sync_domains(context)
|
||||||
except exceptions.Forbidden:
|
except exceptions.Forbidden:
|
||||||
return flask.Response(status=401)
|
return flask.Response(status=401)
|
||||||
except rpc_common.Timeout:
|
except rpc_common.Timeout:
|
||||||
|
|
|
@ -267,9 +267,9 @@ def delete_record(context, domain_id, record_id):
|
||||||
return RPC.call(context, msg)
|
return RPC.call(context, msg)
|
||||||
|
|
||||||
|
|
||||||
def sync_all(context):
|
def sync_domains(context):
|
||||||
msg = {
|
msg = {
|
||||||
'method': 'sync_all',
|
'method': 'sync_domains',
|
||||||
'args': {},
|
'args': {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -596,8 +596,8 @@ class Service(rpc_service.Service):
|
||||||
return self.storage_conn.delete_record(context, record_id)
|
return self.storage_conn.delete_record(context, record_id)
|
||||||
|
|
||||||
# Diagnostics Methods
|
# Diagnostics Methods
|
||||||
def sync_all(self, context):
|
def sync_domains(self, context):
|
||||||
policy.check('diagnostics_sync_all', context)
|
policy.check('diagnostics_sync_domains', context)
|
||||||
|
|
||||||
domains = self.storage_conn.get_domains(context)
|
domains = self.storage_conn.get_domains(context)
|
||||||
results = {}
|
results = {}
|
||||||
|
|
|
@ -20,11 +20,11 @@ from moniker.central import api as central_api
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SyncAllCommand(base.Command):
|
class SyncDomainsCommand(base.Command):
|
||||||
""" Sync Everything """
|
""" Sync All Domains """
|
||||||
|
|
||||||
def execute(self, parsed_args):
|
def execute(self, parsed_args):
|
||||||
return central_api.sync_all(self.context)
|
return central_api.sync_domains(self.context)
|
||||||
|
|
||||||
|
|
||||||
class SyncDomainCommand(base.Command):
|
class SyncDomainCommand(base.Command):
|
||||||
|
|
|
@ -34,8 +34,8 @@ def upgrade(migrate_engine):
|
||||||
domain_count = domains_table.count().execute().first()[0]
|
domain_count = domains_table.count().execute().first()[0]
|
||||||
|
|
||||||
if domain_count > 0:
|
if domain_count > 0:
|
||||||
LOG.warn('A sync-all is now required in order for the API provided, '
|
LOG.warn('A sync-domains is now required in order for the API '
|
||||||
'and backend provided serial numbers to align')
|
'provided, and backend provided serial numbers to align')
|
||||||
|
|
||||||
|
|
||||||
def downgrade(migrate_engine):
|
def downgrade(migrate_engine):
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -97,7 +97,7 @@ setup(
|
||||||
tsigkey-update = moniker.manage.tsigkeys:UpdateTsigKeyCommand
|
tsigkey-update = moniker.manage.tsigkeys:UpdateTsigKeyCommand
|
||||||
tsigkey-delete = moniker.manage.tsigkeys:DeleteTsigKeyCommand
|
tsigkey-delete = moniker.manage.tsigkeys:DeleteTsigKeyCommand
|
||||||
|
|
||||||
sync-all = moniker.manage.sync:SyncAllCommand
|
sync-domains = moniker.manage.sync:SyncDomainsCommand
|
||||||
sync-domain = moniker.manage.sync:SyncDomainCommand
|
sync-domain = moniker.manage.sync:SyncDomainCommand
|
||||||
sync-record = moniker.manage.sync:SyncRecordCommand
|
sync-record = moniker.manage.sync:SyncRecordCommand
|
||||||
"""),
|
"""),
|
||||||
|
|
Loading…
Reference in New Issue