Avoid useless dependency on oslo_utils

Change-Id: Icba21e8b487c2b9a2064212ee2c550ced4be1d2e
This commit is contained in:
Julien Danjou 2016-07-27 17:02:33 +02:00
parent 7f502e2c04
commit cf29274171
3 changed files with 5 additions and 8 deletions

View File

@ -45,12 +45,12 @@ before "proxy-server" and add the following filter in the file:
# Logging level control
log_level = WARNING
"""
import datetime
import functools
import logging
from oslo_config import cfg
import oslo_messaging
from oslo_utils import timeutils
from pycadf import event as cadf_event
from pycadf.helper import api
from pycadf import measurement as cadf_measurement
@ -231,7 +231,7 @@ class Swift(object):
except ValueError:
return
now = timeutils.utcnow().isoformat()
now = datetime.datetime.utcnow().isoformat()
resource_metadata = {
"path": path,

View File

@ -12,10 +12,8 @@
# 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 mock
from oslo_config import cfg
from oslo_utils import timeutils
import six
from ceilometermiddleware import swift
@ -312,9 +310,9 @@ class TestSwift(tests_base.TestCase):
list(app(req.environ, self.start_response))
self.assertEqual(0, len(notify.call_args_list))
@mock.patch.object(timeutils, 'utcnow')
def test_emit_event_fail(self, mocked_time):
mocked_time.side_effect = Exception("a exception")
@mock.patch('six.moves.urllib.parse.quote')
def test_emit_event_fail(self, mocked_func):
mocked_func.side_effect = Exception("a exception")
app = swift.Swift(FakeApp(body=["test"]), {})
req = FakeRequest('/1.0/account/container',
environ={'REQUEST_METHOD': 'GET'})

View File

@ -4,7 +4,6 @@
oslo.config>=3.9.0 # Apache-2.0
oslo.messaging>=4.5.0 # Apache-2.0
oslo.utils>=3.5.0 # Apache-2.0
pbr>=1.6 # Apache-2.0
pycadf!=2.0.0,>=1.1.0 # Apache-2.0
six>=1.9.0 # MIT