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

Adding device_facts module for contribution #53438

Open
wants to merge 9 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@Sajna-Shetty
Copy link

Sajna-Shetty commented Mar 7, 2019

SUMMARY

Submitting dellemc_ome_device_facts module for contribution

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

dellemc_ome_device_facts

ADDITIONAL INFORMATION
    "device_facts": [
            {
                "Actions": null,
                "AssetTag": null,
                "ChassisServiceTag": null,
                "ConnectionState": true,
                "DeviceManagement": [
                    {
                        "DnsName": "dnsname.host.com",
                        "InstrumentationName": "MX-12345",
                        "MacAddress": "11:10:11:10:11:10",
                        "ManagementId": 12345,
                        "ManagementProfile": [
                            {
                                "HasCreds": 0,
                                "ManagementId": 12345,
                                "ManagementProfileId": 12345,
                                "ManagementURL": "https://192.168.0.1:443",
                                "Status": 1000,
                                "StatusDateTime": "2019-01-21 06:30:08.501"
                            }
                        ],
                        "ManagementType": 2,
                        "NetworkAddress": "192.168.0.1"
                    }
                ],
                "DeviceName": "MX-0003I",
                "DeviceServiceTag": "MXL1234",
                "DeviceSubscription": null,
                "LastInventoryTime": "2019-01-21 06:30:08.501",
                "LastStatusTime": "2019-01-21 06:30:02.492",
                "ManagedState": 3000,
                "Model": "PowerEdge MX7000",
                "PowerState": 17,
                "SlotConfiguration": {},
                "Status": 4000,
                "SystemId": 2031,
                "Type": 2000
            }
        ]
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 7, 2019

@ansibot

This comment was marked as resolved.

Copy link
Contributor

ansibot commented Mar 7, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py:73:15: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py:80:18: ansible-format-automatic-specification Format string contains automatic field numbering specification

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:275:46: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:351:25: ansible-format-automatic-specification Format string contains automatic field numbering specification

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:249:69: SyntaxError: device_fact_error_report.update({tag: DESC_HTTP_ERROR for tag in not_available_service_tag})

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:249:69: SyntaxError: invalid syntax

click here for bot help

@ansibot ansibot removed the ci_verified label Mar 7, 2019

@ansibot

This comment was marked as resolved.

Copy link
Contributor

ansibot commented Mar 7, 2019

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:250:69: SyntaxError: device_fact_error_report.update({tag: DESC_HTTP_ERROR for tag in not_available_service_tag})

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:250:69: SyntaxError: invalid syntax

click here for bot help

@ansibot ansibot added the ci_verified label Mar 7, 2019

@ansibot

This comment was marked as resolved.

Copy link
Contributor

ansibot commented Mar 7, 2019

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:291:49: SyntaxError: device_id_dict = {device_id: None for device_id in list(set(device_id_list))}

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py:291:49: SyntaxError: invalid syntax

click here for bot help

@ansibot ansibot removed the ci_verified label Mar 8, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 8, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py:167:0: missing-final-newline Final newline missing
lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py:167:0: mixed-line-endings Mixed line endings LF and CRLF

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py:167:21: W292 no newline at end of file

click here for bot help

@ansibot ansibot added the ci_verified label Mar 8, 2019

@rajeevarakkal
Copy link
Contributor

rajeevarakkal left a comment

good.

@Sajna-Shetty

This comment has been minimized.

Copy link
Author

Sajna-Shetty commented Mar 11, 2019

bot_status

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 11, 2019

Components

lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py
support: community
maintainers: rajeevarakkal

lib/ansible/modules/remote_management/dellemc/ome/init.py
support: community
maintainers: rajeevarakkal

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py
support: community
maintainers: rajeevarakkal

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 0
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainer or core team member): []
shipit_actors_other: []
automerge: automerge shipit test failed

click here for bot help

@rajeevarakkal

This comment has been minimized.

Copy link
Contributor

rajeevarakkal commented Mar 11, 2019

shipit

@Sajna-Shetty

This comment has been minimized.

Copy link
Author

Sajna-Shetty commented Mar 13, 2019

bot_status

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 13, 2019

Components

lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py
support: community
maintainers: rajeevarakkal

lib/ansible/modules/remote_management/dellemc/ome/init.py
support: community
maintainers: rajeevarakkal

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py
support: community
maintainers: rajeevarakkal

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 1
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainers or core team members): rajeevarakkal
shipit_actors_other: []
automerge: automerge shipit test failed

click here for bot help

@Sajna-Shetty

This comment has been minimized.

Copy link
Author

Sajna-Shetty commented Mar 21, 2019

ready_for_review

@Sajna-Shetty

This comment has been minimized.

Copy link
Author

Sajna-Shetty commented Mar 21, 2019

@gundalow
It would be great if you could review this module

@Sajna-Shetty

This comment has been minimized.

Copy link
Author

Sajna-Shetty commented Mar 21, 2019

bot_status

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 21, 2019

Components

lib/ansible/module_utils/remote_management/dellemc/dellemc_ome.py
support: community
maintainers: rajeevarakkal

lib/ansible/modules/remote_management/dellemc/ome/init.py
support: community
maintainers: rajeevarakkal

lib/ansible/modules/remote_management/dellemc/ome/dellemc_ome_device_facts.py
support: community
maintainers: rajeevarakkal

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 1
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainers or core team members): rajeevarakkal
shipit_actors_other: []
automerge: automerge shipit test failed

click here for bot help

@bcoca

This comment has been minimized.

Copy link
Member

bcoca commented Mar 21, 2019

modules that return ansible_facts as their main function should be named with a _facts suffix

@felixfontein

This comment has been minimized.

Copy link
Contributor

felixfontein commented Mar 22, 2019

@bcoca the module has a _facts suffix.

@felixfontein
Copy link
Contributor

felixfontein left a comment

You're currently storing the facts under hostname, which in all your examples is an IP address. This means it must be accessed via ansible_facts['192.168.0.1']. If the hostname happens to be a Python identifier, say example, users can access it directly as example.

Maybe it's better to make this an _info module which doesn't return ansible_facts, but where users have to register: the result. Then users can assign any name they want to the result.

sample: "Failed to fetch the device facts"
ansible_facts:
type: dict
description: Device inventory details.

This comment has been minimized.

@felixfontein

felixfontein Mar 22, 2019

Contributor

I don't think it is clear from this description under which name the result is stored in ansible_facts. Maybe you should add an example which prints out the returned facts.

This comment has been minimized.

@Sajna-Shetty

Sajna-Shetty Mar 25, 2019

Author

Thanks for the review. I have updated the description and example part.

@ansibot ansibot removed the stale_ci label Mar 25, 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.