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
headers= self._client._headers
if mime_type in ['application/yaml', 'text/plain']:
headers['Content-Type'] = 'application/yaml'
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)
if not resp or 'id' not in resp:
raise ClientException('unexpected response from server - {}'.format(
resp))
if not resp or 'id' not in resp:
raise ClientException('unexpected response from server - {}'.format(
resp))