From 703e73d98a52a90cf2f16362fe7b14620b57cd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Thu, 11 Jun 2020 19:01:44 +0200 Subject: [PATCH] fix pep8 issues Change-Id: I597040ac536c1d45ceae5183e48ef809e7db38e9 --- oslo_metrics/__main__.py | 22 ++++++++++++---------- oslo_metrics/message_router.py | 19 ++++++++++--------- oslo_metrics/message_type.py | 17 ++++++++++++++++- oslo_metrics/metrics/oslo_messaging.py | 22 ++++++++++++---------- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/oslo_metrics/__main__.py b/oslo_metrics/__main__.py index cfe74b3..74dec0a 100644 --- a/oslo_metrics/__main__.py +++ b/oslo_metrics/__main__.py @@ -1,16 +1,17 @@ # Copyright 2020 LINE Corp. +# All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the 'License'); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import os import select @@ -53,7 +54,8 @@ class MetricsListener(): def serve(self): while self.start: - readable, writable, exceptional = select.select([self.socket], [], [], 1) + readable, writable, exceptional = select.select( + [self.socket], [], [], 1) if len(readable) == 0: continue try: diff --git a/oslo_metrics/message_router.py b/oslo_metrics/message_router.py index c18ff8c..fc7e0b7 100644 --- a/oslo_metrics/message_router.py +++ b/oslo_metrics/message_router.py @@ -1,16 +1,17 @@ # Copyright 2020 LINE Corp. +# All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the 'License'); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from oslo_log import log as logging from oslo_utils import importutils diff --git a/oslo_metrics/message_type.py b/oslo_metrics/message_type.py index dea2f15..e81f526 100644 --- a/oslo_metrics/message_type.py +++ b/oslo_metrics/message_type.py @@ -1,3 +1,18 @@ +# Copyright 2020 LINE Corp. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import json @@ -27,7 +42,7 @@ class MetricAction(): raise MetricValidationError("action need 'action' field") if metric_action_dict["action"] not in cls.actions: raise MetricValidationError( - "action should be choosen from %s" % cls.actions) + "action should be choosen from %s" % cls.actions) @classmethod def from_dict(cls, metric_action_dict): diff --git a/oslo_metrics/metrics/oslo_messaging.py b/oslo_metrics/metrics/oslo_messaging.py index bbb8ab1..3245bff 100644 --- a/oslo_metrics/metrics/oslo_messaging.py +++ b/oslo_metrics/metrics/oslo_messaging.py @@ -1,16 +1,18 @@ -# Copyright 2019 LINE Corp. +# Copyright 2020 LINE Corp. +# All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the 'License'); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import prometheus_client standard_labels_for_server = [ -- GitLab