hdfs_api.py last minute format improvement went wrong .. fixed

This commit is contained in:
Ilya Golshtein 2021-04-27 13:37:54 +03:00
parent 95dad032a0
commit 6ae4cc6ca7

View File

@ -157,15 +157,15 @@ class HDFSApi(object):
self.kerberos_auth = reqkerb.HTTPKerberosAuth(mutual_authentication=reqkerb.DISABLED, hostname_override=self.host, principal=self.principal)
# print(self.kerberos_auth)
response = self.req_wrapper(requests.put, 307,
url="{protocol}://{host}:{port}/webhdfs/v1{path}?op=CREATE".format(
protocol=self.protocol, host=self.host,
port=self.proxy_port,
path=path, user=self.user),
allow_redirects=False,
headers={'host': 'localhost'},
params={'overwrite' : 'true'},
verify=False, auth=self.kerberos_auth
response = self.req_wrapper(requests.put, 307,
url="{protocol}://{host}:{port}/webhdfs/v1{path}?op=CREATE".format(
protocol=self.protocol, host=self.host,
port=self.proxy_port,
path=path, user=self.user),
allow_redirects=False,
headers={'host': 'localhost'},
params={'overwrite' : 'true'},
verify=False, auth=self.kerberos_auth
)
additional_params = '&'.join(
response.headers['Location'].split('&')[1:2] + ["user.name={}".format(self.user), "overwrite=true"])