Security report is now retrieved by its uuid
* Report uuid is used in the functional test python file * Other changes of this commit only fix misuses of international module gettextutils Change-Id: Id36ffd618ebab1493b5ef4ec86314cb3866ab3c5
This commit is contained in:
parent
f4559a91a4
commit
24a211e711
|
@ -16,7 +16,7 @@
|
|||
|
||||
from oslo.config import cfg
|
||||
|
||||
from cerberus.openstack.common._i18n import _ # noqa
|
||||
from cerberus.openstack.common.gettextutils import _ # noqa
|
||||
|
||||
keystone_opts = [
|
||||
cfg.StrOpt('auth_strategy', default='keystone',
|
||||
|
|
|
@ -20,6 +20,7 @@ from keystoneclient.middleware import auth_token
|
|||
|
||||
from cerberus.common import exception
|
||||
from cerberus.common import safe_utils
|
||||
from cerberus.openstack.common.gettextutils import _ # noqa
|
||||
from cerberus.openstack.common import log
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
from cerberus.openstack.common._i18n import _ # noqa
|
||||
from cerberus.openstack.common.gettextutils import _ # noqa
|
||||
|
||||
|
||||
class InvalidOperation(Exception):
|
||||
|
|
|
@ -23,7 +23,6 @@ SHOULD include dedicated exception logging.
|
|||
"""
|
||||
|
||||
import functools
|
||||
import gettext as t
|
||||
import logging
|
||||
import sys
|
||||
import webob.exc
|
||||
|
@ -32,10 +31,9 @@ from oslo.config import cfg
|
|||
|
||||
from cerberus.common import safe_utils
|
||||
from cerberus.openstack.common import excutils
|
||||
from cerberus.openstack.common.gettextutils import _ # noqa
|
||||
|
||||
|
||||
_ = t.gettext
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
exc_log_opts = [
|
||||
|
|
|
@ -22,6 +22,7 @@ from oslo.config import cfg
|
|||
from oslo.messaging import rpc
|
||||
from stevedore import named
|
||||
|
||||
from cerberus.openstack.common.gettextutils import _ # noqa
|
||||
from cerberus.openstack.common import log
|
||||
from cerberus import utils
|
||||
|
||||
|
|
|
@ -104,7 +104,15 @@ class NotificationTests(base.TestCase):
|
|||
# Check if secu[rity report has been stored in db and delete it
|
||||
report_id = 'test_plugin_report_id'
|
||||
resp, body = self.security_client.get(
|
||||
self.security_client._version + '/security_reports/' + report_id)
|
||||
self.security_client._version + '/security_reports/')
|
||||
|
||||
i = 0
|
||||
security_reports = json.loads(body)['security_reports']
|
||||
while security_reports[i].get('report_id', None) != report_id:
|
||||
i += 1
|
||||
report_uuid = security_reports[i].get('uuid', None)
|
||||
resp, body = self.security_client.get(
|
||||
self.security_client._version + '/security_reports/' + report_uuid)
|
||||
report = json.loads(body)
|
||||
self.assertEqual('a1d869a1-6ab0-4f02-9e56-f83034bacfcb',
|
||||
report['component_id'])
|
||||
|
@ -112,7 +120,7 @@ class NotificationTests(base.TestCase):
|
|||
|
||||
# Delete security report
|
||||
resp, body = self.security_client.delete(
|
||||
self.security_client._version + '/security_reports/' + report_id)
|
||||
self.security_client._version + '/security_reports/' + report_uuid)
|
||||
|
||||
self.assertEqual(204, resp.status)
|
||||
|
||||
|
|
Loading…
Reference in New Issue