Merge "Simplify deployment config format"
This commit is contained in:
commit
6615873983
@ -49,8 +49,6 @@ if [[ "$IDENTITY_API_VERSION" == 2.0 ]]
|
||||
then
|
||||
cat >$1 <<EOF
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "$OS_AUTH_URL",
|
||||
"region_name": "$REGION_NAME",
|
||||
@ -61,15 +59,12 @@ then
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
if [[ "$IDENTITY_API_VERSION" == 3 ]]
|
||||
then
|
||||
cat >$1 <<EOF
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "$OS_AUTH_URL",
|
||||
"region_name": "$REGION_NAME",
|
||||
@ -82,7 +77,6 @@ then
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "http://example.net:5000/v3/",
|
||||
"region_name": "RegionOne",
|
||||
@ -17,4 +15,3 @@
|
||||
"profiler_hmac_key": "SECRET_KEY"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "http://example.net:5000/v3/",
|
||||
"region_name": "RegionOne",
|
||||
@ -16,4 +14,3 @@
|
||||
"https_cacert": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "http://example.net:5000/v2.0/",
|
||||
"region_name": "RegionOne",
|
||||
@ -15,4 +13,3 @@
|
||||
"https_cacert": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "http://example.net:5000/v2.0/",
|
||||
"region_name": "RegionOne",
|
||||
@ -24,4 +22,3 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"auth_url": "http://example.net:5000/v2.0/",
|
||||
"region_name": "RegionOne",
|
||||
@ -14,4 +12,3 @@
|
||||
"https_cacert": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,8 +70,7 @@ class TestTaskSamples(unittest.TestCase):
|
||||
user_ctx.setup()
|
||||
self.addCleanup(user_ctx.cleanup)
|
||||
|
||||
config = deployment["config"]
|
||||
os_creds = config["creds"]["openstack"]
|
||||
os_creds = deployment["config"]["creds"]["openstack"]
|
||||
|
||||
user = copy.copy(os_creds["admin"])
|
||||
user["username"] = ctx["users"][0]["credential"].username
|
||||
@ -81,12 +80,12 @@ class TestTaskSamples(unittest.TestCase):
|
||||
user["project_name"] = ctx["users"][0]["credential"].tenant_name
|
||||
else:
|
||||
user["tenant_name"] = ctx["users"][0]["credential"].tenant_name
|
||||
config["creds"]["openstack"]["users"] = [user]
|
||||
os_creds["users"] = [user]
|
||||
|
||||
rally("deployment destroy MAIN", write_report=False)
|
||||
deployment_cfg = os.path.join(rally.tmp_dir, "new_deployment.json")
|
||||
with open(deployment_cfg, "w") as f:
|
||||
f.write(json.dumps(config))
|
||||
f.write(json.dumps({"openstack": os_creds}))
|
||||
rally("deployment create --name MAIN --filename %s" % deployment_cfg,
|
||||
write_report=False)
|
||||
|
||||
|
@ -516,7 +516,7 @@ def main():
|
||||
out = subprocess.check_output(["rally", "deployment", "config",
|
||||
"--deployment", "devstack"])
|
||||
config = json.loads(out if six.PY2 else out.decode("utf-8"))
|
||||
config = config["creds"]["openstack"]
|
||||
config = config["openstack"]
|
||||
config.update(config.pop("admin"))
|
||||
if "users" in config:
|
||||
del config["users"]
|
||||
|
@ -73,8 +73,6 @@ function setUp () {
|
||||
|
||||
echo '
|
||||
{
|
||||
"type": "ExistingCloud",
|
||||
"creds": {
|
||||
"openstack": {
|
||||
"users": [
|
||||
{"username": "rally-test-user-1",
|
||||
@ -93,7 +91,6 @@ function setUp () {
|
||||
"region_name": "RegionOne"
|
||||
}
|
||||
}
|
||||
}
|
||||
' > $DEPLOYMENT_CONFIG_FILE
|
||||
|
||||
rally deployment create --name devstask-with-users --filename $DEPLOYMENT_CONFIG_FILE
|
||||
|
@ -32,7 +32,7 @@ sed -i.bak "s|#connection =.*|connection = \"$DBCONNSTRING\"|" $TMP_RALLY_CONF
|
||||
rally-manage --config-file $TMP_RALLY_CONF db create
|
||||
|
||||
# Create self deployment
|
||||
echo '{"type": "ExistingCloud", "creds": {}}' > $TMP_RALLY_DEPLOYMENT
|
||||
echo '{}' > $TMP_RALLY_DEPLOYMENT
|
||||
$RALLY -d deployment create --file=$TMP_RALLY_DEPLOYMENT --name=self
|
||||
|
||||
# Run task
|
||||
|
Loading…
x
Reference in New Issue
Block a user