from osmclient.common.exceptions import NotFound
from osmclient.common.exceptions import ClientException
from osmclient.common import utils
from osmclient.common.exceptions import NotFound
from osmclient.common.exceptions import ClientException
from osmclient.common import utils
raise ClientException("failed to delete vnfd {} - {}".format(name, msg))
def create(self, filename, overwrite=None, update_endpoint=None):
raise ClientException("failed to delete vnfd {} - {}".format(name, msg))
def create(self, filename, overwrite=None, update_endpoint=None):
if mime_type is None:
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'
if mime_type is None:
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-Type'] = 'application/gzip'
#headers['Content-Type'] = 'application/binary'
# Next three lines are to be removed in next version
headers['Content-Type'] = 'application/gzip'
#headers['Content-Type'] = 'application/binary'
# Next three lines are to be removed in next version
)
headers["Content-File-MD5"] = utils.md5(filename)
http_header = ['{}: {}'.format(key,val)
)
headers["Content-File-MD5"] = utils.md5(filename)
http_header = ['{}: {}'.format(key,val)
self._http.set_http_header(http_header)
if update_endpoint:
http_code, resp = self._http.put_cmd(endpoint=update_endpoint, filename=filename)
self._http.set_http_header(http_header)
if update_endpoint:
http_code, resp = self._http.put_cmd(endpoint=update_endpoint, filename=filename)