X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fvnfd.py;h=ac44495c856c378526d9eaeabc86c0f85fb0f2ee;hb=refs%2Fchanges%2F70%2F9470%2F2;hp=830708835abc0d241c29ac34ceee2da55b2ddb27;hpb=5b5cd4bd8dbcc8b9ba5fa94209c216e255118a94;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/vnfd.py b/osmclient/sol005/vnfd.py index 8307088..ac44495 100644 --- a/osmclient/sol005/vnfd.py +++ b/osmclient/sol005/vnfd.py @@ -204,7 +204,8 @@ class Vnfd(object): for k in vnfd: # Get only the first descriptor in case there are many in the yaml file # k can be vnfd:vnfd-catalog or vnfd-catalog. This check is skipped - vdu_list = vnfd[k]['vnfd'][0]['vdu'] + first_vnfd = vnfd[k]['vnfd'][0] + vdu_list = first_vnfd.get('vdu',[]) break; for vdu_number, vdu in enumerate(vdu_list): if override_epa: @@ -253,7 +254,7 @@ class Vnfd(object): if resp: resp = json.loads(resp) if not resp or 'id' not in resp: - raise ClientException('unexpected response from server: '.format(resp)) + raise ClientException('unexpected response from server: {}'.format(resp)) print(resp['id']) elif http_code == 204: print('Updated')