b74ea2e4f8
This adds a new group of commands : 'rally use' the first implemented is 'rally use deployment <deploy_id>' As it is not possible in python to export globaly an env var,it saves the variable in a file at ~/.rally/deployment like : RALLY_DEPLOYMENT=1234abcd For each command that takes a deploy_id as parameter, this parameter is now optional. The algorithm to find the deploy_id is as follows : - If the --deploy-id param is set, use it - If the environ contains the key 'RALLY_DEPLOYMENT', use it - load the content of ~/.rally/deployment and if it contains the key RALLY_DEPLOYMENT, use it - Else, raise an InvalidArgumentException Note that I have not been able to use the default arg in @cliutils.args because it is called before the effective method call. Setting deploy_id=envutils.default_deployment_id() has the same problem Partially implements blueprint: rally-use-command Change-Id: I1e62e26d259bd9e81f1c008058ee9ce91cc3290c