We can use file operations directly, no need
to run cat(1)
Change-Id: Id8a9f615dfb11d1bd7acd4a7d6f40545c246e5cd
"""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)