Fixed log messages

Some log messages should be interpolated according to OpenStack Guideline[1]

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages

Change-Id: If0d709b6bf1e4fc761b1addcefe0602cec1be8bc
This commit is contained in:
yankee 2017-02-12 16:05:13 +08:00
parent 0bc1d86606
commit c03973bd61
10 changed files with 53 additions and 53 deletions

View File

@ -141,7 +141,7 @@ class CreateClusterTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.json: if parsed_args.json:
@ -243,7 +243,7 @@ class ListClusterTemplates(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {} search_opts = {}
if parsed_args.plugin: if parsed_args.plugin:
@ -295,7 +295,7 @@ class ShowClusterTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = utils.get_resource( data = utils.get_resource(
@ -324,7 +324,7 @@ class DeleteClusterTemplate(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for ct in parsed_args.cluster_template: for ct in parsed_args.cluster_template:
ct_id = utils.get_resource_id(client.cluster_templates, ct) ct_id = utils.get_resource_id(client.cluster_templates, ct)
@ -443,7 +443,7 @@ class UpdateClusterTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
ct_id = utils.get_resource_id( ct_id = utils.get_resource_id(

View File

@ -142,7 +142,7 @@ class CreateCluster(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
network_client = self.app.client_manager.network network_client = self.app.client_manager.network
@ -203,7 +203,7 @@ class CreateCluster(command.ShowOne):
if not osc_utils.wait_for_status( if not osc_utils.wait_for_status(
client.clusters.get, cluster.id): client.clusters.get, cluster.id):
self.log.error( self.log.error(
'Error occurred during cluster creation: %s' % 'Error occurred during cluster creation: %s',
data['id']) data['id'])
data = {} data = {}
@ -215,7 +215,7 @@ class CreateCluster(command.ShowOne):
if not osc_utils.wait_for_status( if not osc_utils.wait_for_status(
client.clusters.get, data['id']): client.clusters.get, data['id']):
self.log.error( self.log.error(
'Error occurred during cluster creation: %s' % 'Error occurred during cluster creation: %s',
data['id']) data['id'])
data = client.clusters.get(data['id']).to_dict() data = client.clusters.get(data['id']).to_dict()
_format_cluster_output(data) _format_cluster_output(data)
@ -259,7 +259,7 @@ class ListClusters(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {} search_opts = {}
if parsed_args.plugin: if parsed_args.plugin:
@ -328,7 +328,7 @@ class ShowCluster(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
kwargs = {} kwargs = {}
@ -395,7 +395,7 @@ class DeleteCluster(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
clusters = [] clusters = []
for cluster in parsed_args.cluster: for cluster in parsed_args.cluster:
@ -479,7 +479,7 @@ class UpdateCluster(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
cluster_id = utils.get_resource_id( cluster_id = utils.get_resource_id(
@ -547,7 +547,7 @@ class ScaleCluster(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
cluster = utils.get_resource( cluster = utils.get_resource(
@ -639,7 +639,7 @@ class VerificationUpdateCluster(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.show: if parsed_args.show:

View File

@ -83,7 +83,7 @@ class CreateDataSource(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
description = parsed_args.description or '' description = parsed_args.description or ''
@ -124,7 +124,7 @@ class ListDataSources(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {'type': parsed_args.type} if parsed_args.type else {} search_opts = {'type': parsed_args.type} if parsed_args.type else {}
@ -163,7 +163,7 @@ class ShowDataSource(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = utils.get_resource( data = utils.get_resource(
@ -190,7 +190,7 @@ class DeleteDataSource(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for ds in parsed_args.data_source: for ds in parsed_args.data_source:
data_source_id = utils.get_resource_id( data_source_id = utils.get_resource_id(
@ -276,7 +276,7 @@ class UpdateDataSource(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
credentials = {} credentials = {}

View File

@ -57,7 +57,7 @@ class ListImages(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {'tags': parsed_args.tags} if parsed_args.tags else {} search_opts = {'tags': parsed_args.tags} if parsed_args.tags else {}
@ -105,7 +105,7 @@ class ShowImage(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = utils.get_resource( data = utils.get_resource(
@ -145,7 +145,7 @@ class RegisterImage(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
image_client = self.app.client_manager.image image_client = self.app.client_manager.image
@ -180,7 +180,7 @@ class UnregisterImage(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for image in parsed_args.image: for image in parsed_args.image:
image_id = utils.get_resource_id(client.images, image) image_id = utils.get_resource_id(client.images, image)
@ -212,7 +212,7 @@ class SetImageTags(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
image_id = utils.get_resource_id(client.images, parsed_args.image) image_id = utils.get_resource_id(client.images, parsed_args.image)
@ -247,7 +247,7 @@ class AddImageTags(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
image = utils.get_resource(client.images, parsed_args.image) image = utils.get_resource(client.images, parsed_args.image)
@ -290,7 +290,7 @@ class RemoveImageTags(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
image = utils.get_resource(client.images, parsed_args.image) image = utils.get_resource(client.images, parsed_args.image)

View File

@ -99,7 +99,7 @@ class CreateJobBinary(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.json: if parsed_args.json:
@ -173,7 +173,7 @@ class ListJobBinaries(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = client.job_binaries.list() data = client.job_binaries.list()
@ -215,7 +215,7 @@ class ShowJobBinary(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = utils.get_resource( data = utils.get_resource(
@ -243,7 +243,7 @@ class DeleteJobBinary(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for jb in parsed_args.job_binary: for jb in parsed_args.job_binary:
jb = utils.get_resource(client.job_binaries, jb) jb = utils.get_resource(client.job_binaries, jb)
@ -345,7 +345,7 @@ class UpdateJobBinary(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
jb_id = utils.get_resource_id( jb_id = utils.get_resource_id(
@ -408,7 +408,7 @@ class DownloadJobBinary(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if not parsed_args.file: if not parsed_args.file:

View File

@ -100,7 +100,7 @@ class CreateJobTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.json: if parsed_args.json:
@ -168,7 +168,7 @@ class ListJobTemplates(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {'type': parsed_args.type} if parsed_args.type else {} search_opts = {'type': parsed_args.type} if parsed_args.type else {}
@ -211,7 +211,7 @@ class ShowJobTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = utils.get_resource( data = utils.get_resource(
@ -240,7 +240,7 @@ class DeleteJobTemplate(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for jt in parsed_args.job_template: for jt in parsed_args.job_template:
jt_id = utils.get_resource_id(client.jobs, jt) jt_id = utils.get_resource_id(client.jobs, jt)
@ -306,7 +306,7 @@ class UpdateJobTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
jt_id = utils.get_resource_id( jt_id = utils.get_resource_id(

View File

@ -55,7 +55,7 @@ class ListJobTypes(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {} search_opts = {}
@ -113,7 +113,7 @@ class GetJobTypeConfigs(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if not parsed_args.file: if not parsed_args.file:

View File

@ -117,7 +117,7 @@ class ExecuteJob(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.json: if parsed_args.json:
@ -219,7 +219,7 @@ class ListJobs(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = client.job_executions.list() data = client.job_executions.list()
@ -265,7 +265,7 @@ class ShowJob(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = client.job_executions.get(parsed_args.job).to_dict() data = client.job_executions.get(parsed_args.job).to_dict()
@ -299,7 +299,7 @@ class DeleteJob(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for job_id in parsed_args.job: for job_id in parsed_args.job:
client.job_executions.delete(job_id) client.job_executions.delete(job_id)
@ -363,7 +363,7 @@ class UpdateJob(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
update_dict = utils.create_dict_from_kwargs( update_dict = utils.create_dict_from_kwargs(

View File

@ -199,7 +199,7 @@ class CreateNodeGroupTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.json: if parsed_args.json:
@ -310,7 +310,7 @@ class ListNodeGroupTemplates(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
search_opts = {} search_opts = {}
if parsed_args.plugin: if parsed_args.plugin:
@ -362,7 +362,7 @@ class ShowNodeGroupTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = utils.get_resource( data = utils.get_resource(
@ -393,7 +393,7 @@ class DeleteNodeGroupTemplate(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
for ngt in parsed_args.node_group_template: for ngt in parsed_args.node_group_template:
ngt_id = utils.get_resource_id( ngt_id = utils.get_resource_id(
@ -615,7 +615,7 @@ class UpdateNodeGroupTemplate(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
ngt_id = utils.get_resource_id( ngt_id = utils.get_resource_id(

View File

@ -58,7 +58,7 @@ class ListPlugins(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
data = client.plugins.list() data = client.plugins.list()
@ -103,7 +103,7 @@ class ShowPlugin(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if parsed_args.plugin_version: if parsed_args.plugin_version:
@ -160,7 +160,7 @@ class GetPluginConfigs(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
if not parsed_args.file: if not parsed_args.file:
@ -203,7 +203,7 @@ class UpdatePlugin(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args) self.log.debug("take_action(%s)", parsed_args)
client = self.app.client_manager.data_processing client = self.app.client_manager.data_processing
blob = osc_utils.read_blob_file_contents(parsed_args.json) blob = osc_utils.read_blob_file_contents(parsed_args.json)
try: try: