Merge "Avoid useless dependency on oslo_utils"
This commit is contained in:
commit
a5b2377d00
@ -45,12 +45,12 @@ before "proxy-server" and add the following filter in the file:
|
|||||||
# Logging level control
|
# Logging level control
|
||||||
log_level = WARNING
|
log_level = WARNING
|
||||||
"""
|
"""
|
||||||
|
import datetime
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import oslo_messaging
|
import oslo_messaging
|
||||||
from oslo_utils import timeutils
|
|
||||||
from pycadf import event as cadf_event
|
from pycadf import event as cadf_event
|
||||||
from pycadf.helper import api
|
from pycadf.helper import api
|
||||||
from pycadf import measurement as cadf_measurement
|
from pycadf import measurement as cadf_measurement
|
||||||
@ -229,7 +229,7 @@ class Swift(object):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
return
|
return
|
||||||
|
|
||||||
now = timeutils.utcnow().isoformat()
|
now = datetime.datetime.utcnow().isoformat()
|
||||||
|
|
||||||
resource_metadata = {
|
resource_metadata = {
|
||||||
"path": path,
|
"path": path,
|
||||||
|
@ -12,10 +12,8 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from ceilometermiddleware import swift
|
from ceilometermiddleware import swift
|
||||||
@ -312,9 +310,9 @@ class TestSwift(tests_base.TestCase):
|
|||||||
list(app(req.environ, self.start_response))
|
list(app(req.environ, self.start_response))
|
||||||
self.assertEqual(0, len(notify.call_args_list))
|
self.assertEqual(0, len(notify.call_args_list))
|
||||||
|
|
||||||
@mock.patch.object(timeutils, 'utcnow')
|
@mock.patch('six.moves.urllib.parse.quote')
|
||||||
def test_emit_event_fail(self, mocked_time):
|
def test_emit_event_fail(self, mocked_func):
|
||||||
mocked_time.side_effect = Exception("a exception")
|
mocked_func.side_effect = Exception("a exception")
|
||||||
app = swift.Swift(FakeApp(body=["test"]), {})
|
app = swift.Swift(FakeApp(body=["test"]), {})
|
||||||
req = FakeRequest('/1.0/account/container',
|
req = FakeRequest('/1.0/account/container',
|
||||||
environ={'REQUEST_METHOD': 'GET'})
|
environ={'REQUEST_METHOD': 'GET'})
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
oslo.config>=3.9.0 # Apache-2.0
|
oslo.config>=3.9.0 # Apache-2.0
|
||||||
oslo.messaging>=4.5.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
|
pbr>=1.6 # Apache-2.0
|
||||||
pycadf!=2.0.0,>=1.1.0 # Apache-2.0
|
pycadf!=2.0.0,>=1.1.0 # Apache-2.0
|
||||||
six>=1.9.0 # MIT
|
six>=1.9.0 # MIT
|
||||||
|
Loading…
Reference in New Issue
Block a user