xsnippet logotype

xsnippet

#362690, Untitled [ Python 3 ]

by Guest
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from rally.deployment.engines import existing


def create(...):
    config = json.loads()
    try:
        jsonschema.validate(config, existing.ExistingCloud.CONFIG_SCHEMA)
    except ValidationError:
        # convert from new to old format
        new_config = {"type": "ExistingCloud", "creds": config}
        try:
            jsonschema.validate(config, existing.ExistingCloud.CONFIG_SCHEMA)
        except ValidationError:
            raiase
        else:
            config = new_config