[CLI] Add support for emtpy deployment
If no platform is used config is looking like {} and it actually doesn't make any sense to force someone to create file for that This patch allows to create a empty deployment if there is no --filename and --fromenv arguments Change-Id: I15ca37fdf74b153cc2727b6293b841de42227e9f
This commit is contained in:
parent
62341e1f1c
commit
60b3c4302e
@ -22,7 +22,6 @@ fi
|
|||||||
RND=$(head /dev/urandom | tr -dc a-z0-9 | head -c 5)
|
RND=$(head /dev/urandom | tr -dc a-z0-9 | head -c 5)
|
||||||
TMP_RALLY_CONF="/tmp/self-rally-$RND.conf"
|
TMP_RALLY_CONF="/tmp/self-rally-$RND.conf"
|
||||||
TMP_RALLY_DB="/tmp/self-rally-$RND.sqlite"
|
TMP_RALLY_DB="/tmp/self-rally-$RND.sqlite"
|
||||||
TMP_RALLY_DEPLOYMENT="/tmp/self-rally-dep-$RND.json"
|
|
||||||
DBCONNSTRING="sqlite:///$TMP_RALLY_DB"
|
DBCONNSTRING="sqlite:///$TMP_RALLY_DB"
|
||||||
RALLY="rally --config-file $TMP_RALLY_CONF"
|
RALLY="rally --config-file $TMP_RALLY_CONF"
|
||||||
|
|
||||||
@ -32,8 +31,7 @@ sed -i.bak "s|#connection =.*|connection = \"$DBCONNSTRING\"|" $TMP_RALLY_CONF
|
|||||||
rally --config-file $TMP_RALLY_CONF db create
|
rally --config-file $TMP_RALLY_CONF db create
|
||||||
|
|
||||||
# Create self deployment
|
# Create self deployment
|
||||||
echo '{}' > $TMP_RALLY_DEPLOYMENT
|
$RALLY -d deployment create --name=self
|
||||||
$RALLY -d deployment create --file=$TMP_RALLY_DEPLOYMENT --name=self
|
|
||||||
|
|
||||||
# Run task
|
# Run task
|
||||||
$RALLY -d --plugin-paths=$PLUGIN_PATHS task start $TASK_FILE
|
$RALLY -d --plugin-paths=$PLUGIN_PATHS task start $TASK_FILE
|
||||||
|
@ -43,6 +43,11 @@ class DeploymentTestCase(unittest.TestCase):
|
|||||||
"--filename /tmp/.tmp.deployment")
|
"--filename /tmp/.tmp.deployment")
|
||||||
self.assertIn("t_create_file", rally("deployment list"))
|
self.assertIn("t_create_file", rally("deployment list"))
|
||||||
|
|
||||||
|
def test_create_empty(self):
|
||||||
|
rally = utils.Rally()
|
||||||
|
rally("deployment create --name t_empty")
|
||||||
|
self.assertEqual("{}", rally("deployment config"))
|
||||||
|
|
||||||
def test_config(self):
|
def test_config(self):
|
||||||
rally = utils.Rally()
|
rally = utils.Rally()
|
||||||
rally.env.update(utils.TEST_ENV)
|
rally.env.update(utils.TEST_ENV)
|
||||||
|
Loading…
Reference in New Issue
Block a user