Merge "Fix Python 3 issues in cmd"
This commit is contained in:
commit
2cd5904eb8
|
@ -229,7 +229,7 @@ def parse_optional_create(argv):
|
|||
|
||||
for arg in argv:
|
||||
if arg.startswith('-a'):
|
||||
ips = filter(None, arg[2:].split(','))
|
||||
ips = [ip for ip in arg[2:].split(',') if ip]
|
||||
if not ips:
|
||||
usage()
|
||||
optional_args['portals_ips'] = ips
|
||||
|
|
|
@ -14,7 +14,10 @@ import datetime
|
|||
import six
|
||||
import sys
|
||||
|
||||
import mock
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
try:
|
||||
|
@ -533,7 +536,7 @@ class TestCinderManageCmd(test.TestCase):
|
|||
|
||||
self.assertEqual(expected_out, fake_out.getvalue())
|
||||
|
||||
@mock.patch('__builtin__.open')
|
||||
@mock.patch('six.moves.builtins.open')
|
||||
@mock.patch('os.listdir')
|
||||
def test_get_log_commands_errors(self, listdir, open):
|
||||
CONF.set_override('log_dir', 'fake-dir')
|
||||
|
@ -552,7 +555,7 @@ class TestCinderManageCmd(test.TestCase):
|
|||
open.assert_called_once_with('fake-dir/fake-error.log', 'r')
|
||||
listdir.assert_called_once_with(CONF.log_dir)
|
||||
|
||||
@mock.patch('__builtin__.open')
|
||||
@mock.patch('six.moves.builtins.open')
|
||||
@mock.patch('os.path.exists')
|
||||
def test_get_log_commands_syslog_no_log_file(self, path_exists, open):
|
||||
path_exists.return_value = False
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -36,6 +36,7 @@ commands =
|
|||
cinder.tests.unit.targets.test_lio_driver \
|
||||
cinder.tests.unit.targets.test_scst_driver \
|
||||
cinder.tests.unit.targets.test_tgt_driver \
|
||||
cinder.tests.unit.test_api \
|
||||
cinder.tests.unit.test_api_urlmap \
|
||||
cinder.tests.unit.test_backup \
|
||||
cinder.tests.unit.test_backup_ceph \
|
||||
|
@ -45,6 +46,7 @@ commands =
|
|||
cinder.tests.unit.test_block_device \
|
||||
cinder.tests.unit.test_blockbridge \
|
||||
cinder.tests.unit.test_cloudbyte \
|
||||
cinder.tests.unit.test_cmd \
|
||||
cinder.tests.unit.test_conf \
|
||||
cinder.tests.unit.test_context \
|
||||
cinder.tests.unit.test_create_volume_flow \
|
||||
|
|
Loading…
Reference in New Issue