Permalink
Browse files

Make env a commandline option instead of a fabric task

  • Loading branch information...
1 parent 88a7d03 commit fe23f25b0f637633f99af5b224c2c2382be97e9b @tobami committed Nov 11, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 fix
  2. +2 −2 tests/test_command.py
View
4 fix
@@ -47,8 +47,8 @@ else:
littlechef.loglevel = 'debug'
sys.argv.remove('--debug')
for arg in sys.argv:
- if "env:" in arg:
- chef_environment = arg.split(":")[1]
+ if "--env=" in arg:
+ chef_environment = arg.split("=")[1]
if chef_environment == '':
print("Error: No environment was given", file=sys.stderr)
sys.exit(1)
View
@@ -87,13 +87,13 @@ def test_list_commands(self):
class TestEnvironment(BaseTest):
def test_no_value(self):
"""Should error out when the env value is empty"""
- resp, error = self.execute([fix, 'list_nodes', 'env:'])
+ resp, error = self.execute([fix, 'list_nodes', '--env='])
self.assertEquals(resp, "")
self.assertTrue("Error: No environment was given" in error, error)
def test_valid_environment(self):
"""Should set the chef_environment value when one is given"""
- resp, error = self.execute([fix, 'list_nodes', 'env:staging'])
+ resp, error = self.execute([fix, 'list_nodes', '--env=staging'])
self.assertEquals(error, "", error)
self.assertTrue("Environment: staging" in resp, resp)

0 comments on commit fe23f25

Please sign in to comment.