avoid key error is not SHELL env var

This commit is contained in:
Thomas S Hatch 2013-08-10 12:14:10 -06:00
parent 1e27703f3b
commit b09114ec1d

View File

@ -28,7 +28,10 @@ class CMDModuleTest(integration.ModuleCase):
'''
cmd.run
'''
shell = os.environ['SHELL']
shell = os.environ.get('SHELL')
if shell is None:
# Failed to get the SHELL var, don't run
return
self.assertTrue(self.run_function('cmd.run', ['echo $SHELL']))
self.assertEqual(
self.run_function('cmd.run',