from rally.deployment.engines import existing NEW_SCHEMA = {"type": } 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