X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fvnfd.py;h=e939efcacd8990e171c07fe05ba742e7341f90d1;hb=56202fc5897ddf9f58ddca0d1b9860b6b77765e8;hp=b239d5727271a45d53255ca2c58e2301d62df468;hpb=2bf0d905b70cb04c9f32319bc8477d39c54f581a;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/vnfd.py b/osmclient/sol005/vnfd.py index b239d57..e939efc 100644 --- a/osmclient/sol005/vnfd.py +++ b/osmclient/sol005/vnfd.py @@ -23,8 +23,9 @@ from osmclient.common.exceptions import ClientException from osmclient.common import utils import json import magic +from os.path import basename #from os import stat -#from os.path import basename + class Vnfd(object): @@ -125,8 +126,9 @@ class Vnfd(object): raise ClientException( "failed to guess MIME type for file '{}'".format(filename)) headers= self._client._headers - if mime_type in ['application/yaml', 'text/plain']: - headers['Content-Type'] = 'application/yaml' + headers['Content-Filename'] = basename(filename) + if mime_type in ['application/yaml', 'text/plain', 'application/json']: + headers['Content-Type'] = 'text/plain' elif mime_type in ['application/gzip', 'application/x-gzip']: headers['Content-Type'] = 'application/gzip' #headers['Content-Type'] = 'application/binary'