Fix python 3.6 escape char warnings in strings

In python 3.6, escape sequences that are not
recognized in string literals issue DeprecationWarnings.

Convert these to raw strings.

(This is the third patch for this issue.)

Change-Id: Iebcd32aac4d52dbf3649cad51a5c38b0491fc8dd
This commit is contained in:
Eric Harney
2017-08-31 13:23:46 -04:00
parent 298b45a707
commit 465b777624

View File

@@ -1371,8 +1371,8 @@ class TestCinderRtstoolCmd(test.TestCase):
mock_os.path.exists.return_value = False
mock_os.makedirs.side_effect = OSError('error')
regexp = (u'targetcli not installed and could not create default '
'directory \(dirname\): error$')
regexp = (r'targetcli not installed and could not create default '
r'directory \(dirname\): error$')
self.assertRaisesRegexp(cinder_rtstool.RtstoolError, regexp,
cinder_rtstool.save_to_file, None)
@@ -1381,7 +1381,7 @@ class TestCinderRtstoolCmd(test.TestCase):
def test_save_error_saving(self, mock_rtslib, mock_os):
save = mock_rtslib.root.RTSRoot.return_value.save_to_file
save.side_effect = OSError('error')
regexp = u'Could not save configuration to myfile: error'
regexp = r'Could not save configuration to myfile: error'
self.assertRaisesRegexp(cinder_rtstool.RtstoolError, regexp,
cinder_rtstool.save_to_file, 'myfile')