initial stage
This commit is contained in:
parent
26e8789d30
commit
2e72b11447
|
@ -35,7 +35,7 @@ def s3_untar():
|
||||||
def untar(**context):
|
def untar(**context):
|
||||||
hook = S3Hook(S3_CONN_ID, transfer_config_args={'use_threads': False})
|
hook = S3Hook(S3_CONN_ID, transfer_config_args={'use_threads': False})
|
||||||
s3_obj = hook.get_key(context["params"]["src_key"], bucket_name=context["params"]["src_bucket"])
|
s3_obj = hook.get_key(context["params"]["src_key"], bucket_name=context["params"]["src_bucket"])
|
||||||
with tarfile.open(fileobj=s3_obj.get()["Body"], mode='r|') as tar:
|
with tarfile.open(fileobj=s3_obj.get()["Body"], mode='r:*') as tar:
|
||||||
for member in tar:
|
for member in tar:
|
||||||
dst_key = context["params"]["dst_key_prefix"] + "/" + member.name
|
dst_key = context["params"]["dst_key_prefix"] + "/" + member.name
|
||||||
dst_key = os.path.normpath(dst_key)
|
dst_key = os.path.normpath(dst_key)
|
||||||
|
|
Loading…
Reference in New Issue