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

Inventory source with credential has empty dictionary in summary_fields #4059

Closed
AlanCoding opened this issue Jun 12, 2019 · 5 comments
Closed

Comments

@AlanCoding
Copy link
Member

ISSUE TYPE
  • Bug Report
SUMMARY

The UI is not showing content in the credential box in the UI for supported sources like gce

This seems to be because the API gives an empty dictionary where it should summarize that credential in summary_fields

ENVIRONMENT
  • AWX version: 4.0.0
  • AWX install method: openshift, minishift, docker on linux, docker for mac, boot2docker
  • Ansible version: X.Y.Z
  • Operating System:
  • Web Browser:
STEPS TO REPRODUCE

Navigate to a gce inventory source in the UI or API browser

look at the structure you get back

EXPECTED RESULTS

gce sources require a credential, so you probably had a credential, so it should be in summary_fields

ACTUAL RESULTS

non-null credential field, but credential in summary fields is empty

ADDITIONAL INFORMATION
{
    "id": 8,
    "type": "inventory_source",
    "url": "/api/v2/inventory_sources/8/",
    "related": {
        "named_url": "/api/v2/inventory_sources/elijah_gce_inv++Inventory - FunnyGladય++Organization - TieSuckヿ/",
        "created_by": "/api/v2/users/1/",
        "modified_by": "/api/v2/users/1/",
        "credential": "/api/v2/credentials/3/",
        "last_job": "/api/v2/inventory_updates/2/",
        "update": "/api/v2/inventory_sources/8/update/",
        "inventory_updates": "/api/v2/inventory_sources/8/inventory_updates/",
        "schedules": "/api/v2/inventory_sources/8/schedules/",
        "activity_stream": "/api/v2/inventory_sources/8/activity_stream/",
        "hosts": "/api/v2/inventory_sources/8/hosts/",
        "groups": "/api/v2/inventory_sources/8/groups/",
        "notification_templates_any": "/api/v2/inventory_sources/8/notification_templates_any/",
        "notification_templates_success": "/api/v2/inventory_sources/8/notification_templates_success/",
        "notification_templates_error": "/api/v2/inventory_sources/8/notification_templates_error/",
        "inventory": "/api/v2/inventories/2/",
        "last_update": "/api/v2/inventory_updates/2/"
    },
    "summary_fields": {
        "inventory": {
            "id": 2,
            "name": "Inventory - FunnyGladય",
            "description": "ShoppingArgumentReturnChildhoodBreathManyTraditionPostScreenWordଝ",
            "has_active_failures": false,
            "total_hosts": 18,
            "hosts_with_active_failures": 0,
            "total_groups": 61,
            "groups_with_active_failures": 0,
            "has_inventory_sources": true,
            "total_inventory_sources": 1,
            "inventory_sources_with_failures": 0,
            "organization_id": 3,
            "kind": ""
        },
        "credential": {},
        "last_job": {
            "id": 2,
            "name": "Inventory - FunnyGladય - elijah_gce_inv",
            "description": "HideEarthTonightHighlightIndustryConcentrateHighActionDumpFeed滆",
            "finished": "2019-06-12T18:23:26.147879Z",
            "status": "successful",
            "failed": false,
            "license_error": false
        },
        "last_update": {
            "id": 2,
            "name": "Inventory - FunnyGladય - elijah_gce_inv",
            "description": "HideEarthTonightHighlightIndustryConcentrateHighActionDumpFeed滆",
            "status": "successful",
            "failed": false,
            "license_error": false
        },
        "created_by": {
            "id": 1,
            "username": "admin",
            "first_name": "",
            "last_name": ""
        },
        "modified_by": {
            "id": 1,
            "username": "admin",
            "first_name": "",
            "last_name": ""
        },
        "user_capabilities": {
            "edit": true,
            "delete": true,
            "start": true,
            "schedule": true
        }
    },
    "created": "2019-06-12T18:19:46.794703Z",
    "modified": "2019-06-12T18:19:46.794712Z",
    "name": "elijah_gce_inv",
    "description": "HideEarthTonightHighlightIndustryConcentrateHighActionDumpFeed滆",
    "source": "gce",
    "source_path": "",
    "source_script": null,
    "source_vars": "",
    "credential": 3,
    "source_regions": "",
    "instance_filters": "",
    "group_by": "",
    "overwrite": false,
    "overwrite_vars": false,
    "custom_virtualenv": null,
    "timeout": 0,
    "verbosity": 1,
    "last_job_run": "2019-06-12T18:23:26.147879Z",
    "last_job_failed": false,
    "next_job_run": null,
    "status": "successful",
    "inventory": 2,
    "update_on_launch": false,
    "update_cache_timeout": 0,
    "source_project": null,
    "update_on_project_update": false,
    "last_update_failed": false,
    "last_updated": "2019-06-12T18:23:26.147879Z"
}
@kdelee
Copy link
Member

kdelee commented Jun 12, 2019

Screenshot from 2019-06-12 14-45-30

For example, this inventory source has a credential associated but it is not showing in UI

@ryanpetrello
Copy link
Contributor

@AlanCoding @kdelee I'm able to reproduce this on devel.

@ryanpetrello
Copy link
Contributor

@AlanCoding I figured it out.

I was a bit too liberal in my removal of TODOs:

https://github.com/ansible/awx/pull/3413/files#diff-a81324c523b41de7296fdd5ff9063d10L2007

@nicolaibaralmueller
Copy link

nicolaibaralmueller commented Jun 17, 2019

We are experiencing the same bug with devel branch installer. We can't add credentials to inventories.

@kdelee
Copy link
Member

kdelee commented Jun 19, 2019

@nicolaibaralmueller I just tested the fix that was merged a few hours ago. It is working for me now.

Please try again and ping me if it is not working for you. Going to close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants