Simplify deployment config format
There is upgoing work related to deployment refactoring. The bunch of different enitities will be removed and inner code will be rewritten almost from scratch. This patch introduces a new simpler dedployment config format. Despite the fact that it requires several workarounds, we need to merge it before actual refactoring is done, since we want to provide a good deprecation period and as quicker we introduce a new format as quicker we will able to remove deprecated stuff:) An example of old deployment config: { "type": "ExistingCloud", "creds": { "openstack": { "auth_url": "https://example.com", "admin": { "username": "admin", "password": "pass", "project_name": "admin" } } } } An example of a new format: { "openstack": { "auth_url": "https://example.com", "admin": { "username": "admin", "password": "pass", "project_name": "admin" } } } Change-Id: If88317a0aefdd3d1adc6c380672d83e2bad11f15
This commit is contained in:
parent
27fd7b1b12
commit
57d2a22dfd
@ -49,8 +49,6 @@ if [[ "$IDENTITY_API_VERSION" == 2.0 ]]
|
|||||||
then
|
then
|
||||||
cat >$1 <<EOF
|
cat >$1 <<EOF
|
||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "$OS_AUTH_URL",
|
"auth_url": "$OS_AUTH_URL",
|
||||||
"region_name": "$REGION_NAME",
|
"region_name": "$REGION_NAME",
|
||||||
@ -60,7 +58,6 @@ then
|
|||||||
"tenant_name": "admin",
|
"tenant_name": "admin",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
@ -68,8 +65,6 @@ if [[ "$IDENTITY_API_VERSION" == 3 ]]
|
|||||||
then
|
then
|
||||||
cat >$1 <<EOF
|
cat >$1 <<EOF
|
||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "$OS_AUTH_URL",
|
"auth_url": "$OS_AUTH_URL",
|
||||||
"region_name": "$REGION_NAME",
|
"region_name": "$REGION_NAME",
|
||||||
@ -81,7 +76,6 @@ then
|
|||||||
"project_domain_name": "Default"
|
"project_domain_name": "Default"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "http://example.net:5000/v3/",
|
"auth_url": "http://example.net:5000/v3/",
|
||||||
"region_name": "RegionOne",
|
"region_name": "RegionOne",
|
||||||
@ -16,5 +14,4 @@
|
|||||||
"https_cacert": "",
|
"https_cacert": "",
|
||||||
"profiler_hmac_key": "SECRET_KEY"
|
"profiler_hmac_key": "SECRET_KEY"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "http://example.net:5000/v3/",
|
"auth_url": "http://example.net:5000/v3/",
|
||||||
"region_name": "RegionOne",
|
"region_name": "RegionOne",
|
||||||
@ -15,5 +13,4 @@
|
|||||||
"https_insecure": false,
|
"https_insecure": false,
|
||||||
"https_cacert": ""
|
"https_cacert": ""
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "http://example.net:5000/v2.0/",
|
"auth_url": "http://example.net:5000/v2.0/",
|
||||||
"region_name": "RegionOne",
|
"region_name": "RegionOne",
|
||||||
@ -14,5 +12,4 @@
|
|||||||
"https_insecure": false,
|
"https_insecure": false,
|
||||||
"https_cacert": ""
|
"https_cacert": ""
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "http://example.net:5000/v2.0/",
|
"auth_url": "http://example.net:5000/v2.0/",
|
||||||
"region_name": "RegionOne",
|
"region_name": "RegionOne",
|
||||||
@ -23,5 +21,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"auth_url": "http://example.net:5000/v2.0/",
|
"auth_url": "http://example.net:5000/v2.0/",
|
||||||
"region_name": "RegionOne",
|
"region_name": "RegionOne",
|
||||||
@ -13,5 +11,4 @@
|
|||||||
"https_insecure": false,
|
"https_insecure": false,
|
||||||
"https_cacert": ""
|
"https_cacert": ""
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,7 @@ class TestTaskSamples(unittest.TestCase):
|
|||||||
user_ctx.setup()
|
user_ctx.setup()
|
||||||
self.addCleanup(user_ctx.cleanup)
|
self.addCleanup(user_ctx.cleanup)
|
||||||
|
|
||||||
config = deployment["config"]
|
os_creds = deployment["config"]["creds"]["openstack"]
|
||||||
os_creds = config["creds"]["openstack"]
|
|
||||||
|
|
||||||
user = copy.copy(os_creds["admin"])
|
user = copy.copy(os_creds["admin"])
|
||||||
user["username"] = ctx["users"][0]["credential"].username
|
user["username"] = ctx["users"][0]["credential"].username
|
||||||
@ -81,12 +80,12 @@ class TestTaskSamples(unittest.TestCase):
|
|||||||
user["project_name"] = ctx["users"][0]["credential"].tenant_name
|
user["project_name"] = ctx["users"][0]["credential"].tenant_name
|
||||||
else:
|
else:
|
||||||
user["tenant_name"] = ctx["users"][0]["credential"].tenant_name
|
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)
|
rally("deployment destroy MAIN", write_report=False)
|
||||||
deployment_cfg = os.path.join(rally.tmp_dir, "new_deployment.json")
|
deployment_cfg = os.path.join(rally.tmp_dir, "new_deployment.json")
|
||||||
with open(deployment_cfg, "w") as f:
|
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,
|
rally("deployment create --name MAIN --filename %s" % deployment_cfg,
|
||||||
write_report=False)
|
write_report=False)
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ def main():
|
|||||||
out = subprocess.check_output(["rally", "deployment", "config",
|
out = subprocess.check_output(["rally", "deployment", "config",
|
||||||
"--deployment", "devstack"])
|
"--deployment", "devstack"])
|
||||||
config = json.loads(out if six.PY2 else out.decode("utf-8"))
|
config = json.loads(out if six.PY2 else out.decode("utf-8"))
|
||||||
config = config["creds"]["openstack"]
|
config = config["openstack"]
|
||||||
config.update(config.pop("admin"))
|
config.update(config.pop("admin"))
|
||||||
if "users" in config:
|
if "users" in config:
|
||||||
del config["users"]
|
del config["users"]
|
||||||
|
@ -73,8 +73,6 @@ function setUp () {
|
|||||||
|
|
||||||
echo '
|
echo '
|
||||||
{
|
{
|
||||||
"type": "ExistingCloud",
|
|
||||||
"creds": {
|
|
||||||
"openstack": {
|
"openstack": {
|
||||||
"users": [
|
"users": [
|
||||||
{"username": "rally-test-user-1",
|
{"username": "rally-test-user-1",
|
||||||
@ -92,7 +90,6 @@ function setUp () {
|
|||||||
"auth_url": "'$OS_AUTH_URL'",
|
"auth_url": "'$OS_AUTH_URL'",
|
||||||
"region_name": "RegionOne"
|
"region_name": "RegionOne"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
' > $DEPLOYMENT_CONFIG_FILE
|
' > $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
|
rally-manage --config-file $TMP_RALLY_CONF db create
|
||||||
|
|
||||||
# Create self deployment
|
# Create self deployment
|
||||||
echo '{"type": "ExistingCloud", "creds": {}}' > $TMP_RALLY_DEPLOYMENT
|
echo '{}' > $TMP_RALLY_DEPLOYMENT
|
||||||
$RALLY -d deployment create --file=$TMP_RALLY_DEPLOYMENT --name=self
|
$RALLY -d deployment create --file=$TMP_RALLY_DEPLOYMENT --name=self
|
||||||
|
|
||||||
# Run task
|
# Run task
|
||||||
|
Loading…
Reference in New Issue
Block a user