X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fsdncontroller.py;h=b02632eac3ab879190711a522efd2c0caab622dc;hb=e0fb4995c67792f01648cbc7e331879fc661a572;hp=35ad9ee2a569a70826015c2e2eb77acae42b485d;hpb=bd39b09580560307a1ac23be4984783d1bea9238;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/sdncontroller.py b/osmclient/sol005/sdncontroller.py index 35ad9ee..b02632e 100644 --- a/osmclient/sol005/sdncontroller.py +++ b/osmclient/sol005/sdncontroller.py @@ -24,6 +24,7 @@ from osmclient.common.exceptions import ClientException from osmclient.common.exceptions import NotFound import json import logging +import yaml class SdnController(object): @@ -66,6 +67,8 @@ class SdnController(object): def create(self, name, sdn_controller, wait=False): self._logger.debug("") + if 'config' in sdn_controller and isinstance(sdn_controller["config"], str): + sdn_controller["config"] = yaml.safe_load(sdn_controller["config"]) self._client.get_token() http_code, resp = self._http.post_cmd(endpoint=self._apiBase, postfields_dict=sdn_controller) @@ -92,6 +95,8 @@ class SdnController(object): def update(self, name, sdn_controller, wait=False): self._logger.debug("") + if 'config' in sdn_controller and isinstance(sdn_controller["config"], str): + sdn_controller["config"] = yaml.safe_load(sdn_controller["config"]) self._client.get_token() sdnc = self.get(name) sdnc_id_for_wait = self._get_id_for_wait(name)