diff --git a/swift/common/daemon.py b/swift/common/daemon.py index 9eee9419d2..7e7c4cd8fb 100644 --- a/swift/common/daemon.py +++ b/swift/common/daemon.py @@ -267,7 +267,7 @@ def run_daemon(klass, conf_file, section_name='', once=False, **kwargs): """ # very often the config section_name is based on the class name # the None singleton will be passed through to readconf as is - if section_name is '': + if section_name == '': section_name = sub(r'([a-z])([A-Z])', r'\1-\2', klass.__name__).lower() try: diff --git a/swift/common/middleware/acl.py b/swift/common/middleware/acl.py index cef7022642..b0a01166c4 100644 --- a/swift/common/middleware/acl.py +++ b/swift/common/middleware/acl.py @@ -217,7 +217,7 @@ def parse_acl_v2(data): """ if data is None: return None - if data is '': + if data == '': return {} try: result = json.loads(data) diff --git a/test/unit/common/middleware/s3api/test_s3request.py b/test/unit/common/middleware/s3api/test_s3request.py index d62fa71c41..7cc73a813e 100644 --- a/test/unit/common/middleware/s3api/test_s3request.py +++ b/test/unit/common/middleware/s3api/test_s3request.py @@ -187,7 +187,7 @@ class TestRequest(S3ApiTestCase): self.assertEqual(mock_get_resp.call_count, 2) args, kargs = mock_get_resp.call_args_list[0] get_resp_obj = args[3] - self.assertTrue(get_resp_obj is '') + self.assertEqual(get_resp_obj, '') self.assertEqual(m_check_permission.call_count, 1) args, kargs = m_check_permission.call_args permission = args[1] diff --git a/test/unit/common/test_wsgi.py b/test/unit/common/test_wsgi.py index 6cefb4ac70..dd3ceff258 100644 --- a/test/unit/common/test_wsgi.py +++ b/test/unit/common/test_wsgi.py @@ -600,7 +600,7 @@ class TestWSGI(unittest.TestCase): logger = logging.getLogger('test') sock = listen_zero() wsgi.run_server(conf, logger, sock) - self.assertTrue(os.environ['TZ'] is not '') + self.assertNotEqual(os.environ['TZ'], '') self.assertEqual(30, _wsgi.WRITE_TIMEOUT) _wsgi_evt.hubs.use_hub.assert_called_with(utils.get_hub())