raise ClientException("A profile must be provided for each KSU")
if "oka" in ksu:
for oka in ksu["oka"]:
- if "_id" in oka:
- oka["_id"] = get_oka_id(ctx, oka["_id"])
+ oka_id = oka.get("_id", "")
+ if oka_id:
+ oka["_id"] = get_oka_id(ctx, oka_id)
elif "sw_catalog_path" not in oka:
raise ClientException(
"An OKA id or name, or a SW catalog path must be provided for each OKA"
raise ClientException(
"No path was provided after --sw-catalog-path"
)
+ oka_dict["_id"] = ""
oka_dict["sw_catalog_path"] = oka_args[i + 1]
i = i + 2
continue
for ksu in ksu_params:
verify_and_update_ksu(ctx, ksu)
logger.debug(f"ksu_params:\n{yaml.safe_dump(ksu_params)}")
- ctx.obj.ksu.multi_create_update(ksu_params, "create")
+ ctx.obj.ksu.multi_create_update({"ksus": ksu_params}, "")
@click.command(name="ksu-delete", short_help="deletes one or several KSU")
"""Create or update a bundle of Generic OSM API Object specified by content"""
self._logger.debug("")
self._client.get_token()
- endpoint = f"{self._apiBase}/{endpoint_suffix}"
+ if endpoint_suffix:
+ endpoint = f"{self._apiBase}/{endpoint_suffix}"
+ else:
+ endpoint = f"{self._apiBase}"
http_code, resp = self.generic_post(endpoint=endpoint, content=content)
if http_code in (200, 201, 202):
if not resp: