diff options
author | Jordan Cazamias <jordan.cazamias@rackspace.com> | 2014-06-10 09:36:45 -0500 |
---|---|---|
committer | Jordan Cazamias <jordan.cazamias@rackspace.com> | 2014-06-11 17:08:45 -0500 |
commit | a0d9b4cac6c1a65efedc32304736818fb816c3c9 (patch) | |
tree | bdba44eab1595aa029f68050a8cdc5733fdc39c0 /designate/manage | |
parent | d9b15425ed27cd83a8a865992d96194ffa4c65fb (diff) | |
download | designate-a0d9b4cac6c1a65efedc32304736818fb816c3c9.tar.gz |
Change log statements to meet I18n guidelines
Change-Id: Id76bcb71369302a559d2c2c5bd6046dff05a488e
Implements: blueprint standardize-logging
Diffstat (limited to 'designate/manage')
-rw-r--r-- | designate/manage/database.py | 11 | ||||
-rw-r--r-- | designate/manage/powerdns.py | 11 | ||||
-rw-r--r-- | designate/manage/tlds.py | 10 |
3 files changed, 18 insertions, 14 deletions
diff --git a/designate/manage/database.py b/designate/manage/database.py index 6dad7e33..9c3e5f1f 100644 --- a/designate/manage/database.py +++ b/designate/manage/database.py @@ -19,6 +19,7 @@ from migrate.exceptions import (DatabaseAlreadyControlledError, DatabaseNotControlledError) from migrate.versioning import api as versioning_api from designate.openstack.common import log as logging +from designate.openstack.common.gettextutils import _LI from oslo.config import cfg from designate.manage import base @@ -36,9 +37,9 @@ class DatabaseCommands(base.Commands): url = cfg.CONF['storage:sqlalchemy'].database_connection try: - LOG.info('Attempting to initialize database') + LOG.info(_LI('Attempting to initialize database')) versioning_api.version_control(url=url, repository=REPOSITORY) - LOG.info('Database initialized successfully') + LOG.info(_LI('Database initialized successfully')) except DatabaseAlreadyControlledError: raise Exception('Database already initialized') @@ -57,8 +58,8 @@ class DatabaseCommands(base.Commands): except DatabaseNotControlledError: raise Exception('Database not yet initialized') - LOG.info("Attempting to synchronize database from version " - "'%s' to '%s'", + LOG.info(_LI("Attempting to synchronize database from version " + "'%s' to '%s'"), current_version, target_version if target_version is not None else "latest") @@ -69,7 +70,7 @@ class DatabaseCommands(base.Commands): versioning_api.upgrade(url=url, repository=REPOSITORY, version=version) - LOG.info('Database synchronized successfully') + LOG.info(_LI('Database synchronized successfully')) def version(self): url = cfg.CONF['storage:sqlalchemy'].database_connection diff --git a/designate/manage/powerdns.py b/designate/manage/powerdns.py index 1d07b1c0..2c64e56e 100644 --- a/designate/manage/powerdns.py +++ b/designate/manage/powerdns.py @@ -18,6 +18,7 @@ from migrate.exceptions import (DatabaseAlreadyControlledError, DatabaseNotControlledError) from migrate.versioning import api as versioning_api from designate.openstack.common import log as logging +from designate.openstack.common.gettextutils import _LI from oslo.config import cfg from designate.manage import base @@ -38,9 +39,9 @@ class DatabaseCommands(base.Commands): raise Exception('Migration Repository Not Found') try: - LOG.info('Attempting to initialize PowerDNS database') + LOG.info(_LI('Attempting to initialize PowerDNS database')) versioning_api.version_control(url=url, repository=REPOSITORY) - LOG.info('PowerDNS database initialized successfully') + LOG.info(_LI('PowerDNS database initialized successfully')) except DatabaseAlreadyControlledError: raise Exception('PowerDNS Database already initialized') @@ -59,8 +60,8 @@ class DatabaseCommands(base.Commands): except DatabaseNotControlledError: raise Exception('PowerDNS database not yet initialized') - LOG.info("Attempting to synchronize PowerDNS database from version " - "'%s' to '%s'", + LOG.info(_LI("Attempting to synchronize PowerDNS database " + "from version '%s' to '%s'"), current_version, target_version if target_version is not None else "latest") @@ -71,7 +72,7 @@ class DatabaseCommands(base.Commands): versioning_api.upgrade(url=url, repository=REPOSITORY, version=version) - LOG.info('PowerDNS database synchronized successfully') + LOG.info(_LI('PowerDNS database synchronized successfully')) def version(self): url = cfg.CONF['backend:powerdns'].database_connection diff --git a/designate/manage/tlds.py b/designate/manage/tlds.py index bb096ade..24d4bc03 100644 --- a/designate/manage/tlds.py +++ b/designate/manage/tlds.py @@ -21,6 +21,8 @@ from designate import exceptions from designate import rpc from designate.central import rpcapi as central_rpcapi from designate.openstack.common import log as logging +from designate.openstack.common.gettextutils import _LI +from designate.openstack.common.gettextutils import _LE from designate.manage import base from designate.schema import format @@ -108,7 +110,7 @@ class TLDCommands(base.Commands): if not os.path.exists(input_file): raise Exception('TLD Input file Not Found') - LOG.info("Importing TLDs from %s", input_file) + LOG.info(_LI("Importing TLDs from %s"), input_file) error_lines = [] tlds_added = 0 @@ -128,11 +130,11 @@ class TLDCommands(base.Commands): tlds_added += self._validate_and_create_tld(line, error_lines) - LOG.info("Number of tlds added: %d", tlds_added) + LOG.info(_LI("Number of tlds added: %d"), tlds_added) errors = len(error_lines) if errors > 0: - LOG.error("Number of errors: %d", errors) + LOG.error(_LE("Number of errors: %d"), errors) # Sorting the errors and printing them so that it is easier to # read the errors - LOG.error("Error Lines:\n%s", '\n'.join(sorted(error_lines))) + LOG.error(_LE("Error Lines:\n%s"), '\n'.join(sorted(error_lines))) |