From 9e1c6d0c799613ab692bd0bd8e19c3c2a51130d2 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 10 Aug 2012 11:54:34 +0100 Subject: Sync some cleanups from openstack.common Changes to openstack.common.notifier: - fix bug lp:1019348,update openstack-common to support pep8 1.3. Changes to openstack.common.setup: - Fix errors reported by pyflakes Changes to openstack.common.timeutils: - Remove unused imports Change-Id: Iac46d11a996857c84e06a8dbd3ecfcd774142ef8 --- nova/openstack/common/notifier/log_notifier.py | 3 ++- nova/openstack/common/notifier/rabbit_notifier.py | 6 +++--- nova/openstack/common/setup.py | 5 ++--- nova/openstack/common/timeutils.py | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'nova/openstack') diff --git a/nova/openstack/common/notifier/log_notifier.py b/nova/openstack/common/notifier/log_notifier.py index ede96a019..a334f92e7 100644 --- a/nova/openstack/common/notifier/log_notifier.py +++ b/nova/openstack/common/notifier/log_notifier.py @@ -30,5 +30,6 @@ def notify(_context, message): CONF.default_notification_level) priority = priority.lower() logger = logging.getLogger( - 'nova.openstack.common.notification.%s' % message['event_type']) + 'nova.openstack.common.notification.%s' % + message['event_type']) getattr(logger, priority)(jsonutils.dumps(message)) diff --git a/nova/openstack/common/notifier/rabbit_notifier.py b/nova/openstack/common/notifier/rabbit_notifier.py index d37b5ea65..c7b3f54fe 100644 --- a/nova/openstack/common/notifier/rabbit_notifier.py +++ b/nova/openstack/common/notifier/rabbit_notifier.py @@ -22,9 +22,9 @@ from nova.openstack.common import rpc LOG = logging.getLogger(__name__) -notification_topic_opt = cfg.ListOpt('notification_topics', - default=['notifications', ], - help='AMQP topic used for openstack notifications') +notification_topic_opt = cfg.ListOpt( + 'notification_topics', default=['notifications', ], + help='AMQP topic used for openstack notifications') CONF = cfg.CONF CONF.register_opt(notification_topic_opt) diff --git a/nova/openstack/common/setup.py b/nova/openstack/common/setup.py index 59f255d0c..628f5e3c9 100644 --- a/nova/openstack/common/setup.py +++ b/nova/openstack/common/setup.py @@ -52,7 +52,6 @@ def canonicalize_emails(changelog, mapping): # Get requirements from the first file that exists def get_reqs_from_files(requirements_files): - reqs_in = [] for requirements_file in requirements_files: if os.path.exists(requirements_file): return open(requirements_file, 'r').read().split('\n') @@ -144,8 +143,8 @@ def _get_git_next_version_suffix(branch_name): # where the bit after the last . is the short sha, and the bit between # the last and second to last is the revno count (revno, sha) = post_version.split(".")[-2:] - first_half = "%(milestonever)s~%(datestamp)s" % locals() - second_half = "%(revno_prefix)s%(revno)s.%(sha)s" % locals() + first_half = "%s~%s" % (milestonever, datestamp) + second_half = "%s%s.%s" % (revno_prefix, revno, sha) return ".".join((first_half, second_half)) diff --git a/nova/openstack/common/timeutils.py b/nova/openstack/common/timeutils.py index 5eeaf70aa..4416a3b19 100644 --- a/nova/openstack/common/timeutils.py +++ b/nova/openstack/common/timeutils.py @@ -21,7 +21,6 @@ Time related utilities and helper functions. import calendar import datetime -import time import iso8601 -- cgit