Avoid winning the useless use of cat award

We can use file operations directly, no need
to run cat(1)

Change-Id: Id8a9f615dfb11d1bd7acd4a7d6f40545c246e5cd
This commit is contained in:
Dirk Mueller 2013-06-23 14:06:55 +02:00
parent 0c15581516
commit 7c0e21ad3f
1 changed files with 3 additions and 6 deletions

View File

@ -91,14 +91,11 @@ class TestWSGIServer(test.TestCase):
"""WSGI server tests."""
def _ipv6_configured():
try:
out, err = utils.execute('cat', '/proc/net/if_inet6')
except exception.ProcessExecutionError:
with file('/proc/net/if_inet6') as f:
return len(f.read()) > 0
except IOError:
return False
if not out:
return False
return True
def test_no_app(self):
server = cinder.wsgi.Server("test_app", None)
self.assertEquals("test_app", server.name)