Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upload for gcp_storage_object module #57141

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
2 participants
@marcusrafael
Copy link

commented May 29, 2019

Closes #57140

SUMMARY
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

gcp_storage_object

ADDITIONAL INFORMATION
BEFORE
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "/home/ansible/.ansible/tmp/ansible-tmp-1559152385.660594-245273378382856/AnsiballZ_gcp_storage_object.py:68: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses\n  import imp\nTraceback (most recent call last):\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1559152385.660594-245273378382856/AnsiballZ_gcp_storage_object.py\", line 262, in <module>\n    _ansiballz_main()\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1559152385.660594-245273378382856/AnsiballZ_gcp_storage_object.py\", line 252, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1559152385.660594-245273378382856/AnsiballZ_gcp_storage_object.py\", line 120, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/usr/lib/python3.7/imp.py\", line 234, in load_module\n    return load_source(name, filename, file)\n  File \"/usr/lib/python3.7/imp.py\", line 169, in load_source\n    module = _exec(spec, sys.modules[name])\n  File \"<frozen importlib._bootstrap>\", line 630, in _exec\n  File \"<frozen importlib._bootstrap_external>\", line 728, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n  File \"/tmp/ansible_gcp_storage_object_payload_pk1f5ss7/__main__.py\", line 284, in <module>\n  File \"/tmp/ansible_gcp_storage_object_payload_pk1f5ss7/__main__.py\", line 188, in main\n  File \"/tmp/ansible_gcp_storage_object_payload_pk1f5ss7/__main__.py\", line 204, in upload_file\n  File \"/tmp/ansible_gcp_storage_object_payload_pk1f5ss7/ansible_gcp_storage_object_payload.zip/ansible/module_utils/gcp_utils.py\", line 96, in post_contents\nAttributeError: 'GcpSession' object has no attribute 'merge_dictionaries'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
AFTER
changed: [localhost] => {
    "bucket": "some",
    "changed": true,
    "crc32c": "AAAAAA==",
    "etag": "AAAAAAAAAAAAA=",
    "generation": "AAAAAAAAAAAAA",
    "id": "some/anything.txt/AAAAAAAAAAAAA",
    "invocation": {
        "module_args": {
            "action": "upload",
            "auth_kind": "serviceaccount",
            "bucket": "some",
            "dest": "anything.txt",
            "overwrite": true,
            "project": "anything",
            "scopes": [
                "https://www.googleapis.com/auth/devstorage.full_control"
            ],
            "service_account_contents": null,
            "service_account_email": null,
            "service_account_file": "/home/ansible/.gcloud/anything.json",
            "src": "/home/ansible/bucket/anything.txt",
            "state": "present"
        }
    },
    "kind": "storage#object",
    "md5Hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAA==",
    "mediaLink": "https://www.googleapis.com/download/storage/v1/b/some/o/anything.txt?generation=AAAAAAAAAAAAA&alt=media",
    "metageneration": "1",
    "name": "anything.txt",
    "selfLink": "https://www.googleapis.com/storage/v1/b/some/o/anything.txt",
    "size": "7",
    "storageClass": "MULTI_REGIONAL",
    "timeCreated": "2019-05-29T17:52:31.711Z",
    "timeStorageClassUpdated": "2019-05-29T17:52:31.711Z",
    "updated": "2019-05-29T17:52:31.711Z"
}
@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.