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

idrac_network.py fails with AttributeError: 'NoneType' object has no attribute 'iDRAC' #266

Closed
grantcurell opened this issue Apr 15, 2021 · 1 comment · Fixed by #268
Closed

Comments

@grantcurell
Copy link
Contributor

When attempting to update the idrac IP with input:

{
    "ANSIBLE_MODULE_ARGS": {
        "idrac_ip": "192.168.1.63",
        "idrac_user": "root",
        "idrac_password": "mypassword",
        "share_name": "\\\\192.168.1.156\\sambashare",
        "share_user": "grant",
        "share_password": "mypassword",
        "ip_address": "192.168.1.64"
    }
}

I receive:

  File "/home/grant/programs/dellemc-openmanage-ansible-modules/plugins/modules/idrac_network.py", line 399, in main
    msg = run_idrac_network_config(idrac, module)
  File "/home/grant/programs/dellemc-openmanage-ansible-modules/plugins/modules/idrac_network.py", line 309, in run_idrac_network_config
    idrac.config_mgr.configure_ipv4(
  File "/home/grant/.local/lib/python3.8/site-packages/omdrivers/lifecycle/iDRAC/iDRACConfig.py", line 4230, in configure_ipv4
    self.iDRAC_IPv4.Address_IPv4.set_value(ip_address)
  File "/home/grant/.local/lib/python3.8/site-packages/omdrivers/lifecycle/iDRAC/iDRACConfig.py", line 4176, in iDRAC_IPv4
    return self._sysconfig.iDRAC.IPv4
AttributeError: 'NoneType' object has no attribute 'iDRAC'

I've run the error down and it occurs because my instance of omdrivers.lifecycle.iDRAC.iDRACConfig.iDRACConfig has no value _sysconfig in:

@property
def iDRAC_IPv4(self):
    return self._sysconfig.iDRAC.IPv4
@grantcurell
Copy link
Contributor Author

This happens because the liason share is required but there is no error handling in the event that a connection to the share fails. Since this is not handled it eventually results in the nonetype object. Specifically _load_scp in iDRACConfig.py fails but that failure is never accounted for.

grantcurell added a commit to grantcurell/dellemc-openmanage-ansible-modules that referenced this issue Apr 16, 2021
README.md:
- Added TOC
- Based on user feedback took @anupamaloke 's answer and provided an explanation for the required shares along with how to easily handle the share
- Changed the header Playbooks to Sample Playbooks so user's would have a better idea of what was there

idrac_network.py:
- Added error handling such that if the share is not valid the module gracefully fails. Fixes dell#266
- Removed open_url from imports since it was unused

Signed-off-by: Grant Curell <grant_curell@dell.com>
grantcurell added a commit to grantcurell/dellemc-openmanage-ansible-modules that referenced this issue May 3, 2021
README.md:
- Added TOC
- Based on user feedback took @anupamaloke 's answer and provided an explanation for the required shares along with how to easily handle the share
- Changed the header Playbooks to Sample Playbooks so user's would have a better idea of what was there

idrac_network.py:
- Added error handling such that if the share is not valid the module gracefully fails. Fixes dell#266
- Fixes dell#194
- Removed open_url from imports since it was unused

Signed-off-by: Grant Curell <grant_curell@dell.com>
grantcurell added a commit to grantcurell/dellemc-openmanage-ansible-modules that referenced this issue May 3, 2021
README.md:
- Added TOC
- Based on user feedback took @anupamaloke 's answer and provided an explanation for the required shares along with how to easily handle the share
- Changed the header Playbooks to Sample Playbooks so user's would have a better idea of what was there

dellemc_configure_idrac_eventing.py
dellemc_configure_idrac_services.py
dellemc_idrac_lc_attributes.py
dellemc_system_lockdown_mode.py
idrac_bios.py
idrac_firmware.py
idrac_network.py
idrac_syslog.pyidrac_timezone_ntp.py:
- Added error handling such that if a share is used and not valid the module gracefully fails.
- Fixes dell#266
- Fixes dell#194
- Fixes dell#154

All files:
- optimized imports

Signed-off-by: Grant Curell <grant_curell@dell.com>
grantcurell added a commit to grantcurell/dellemc-openmanage-ansible-modules that referenced this issue May 3, 2021
README.md:
- Added TOC
- Based on user feedback took @anupamaloke 's answer and provided an explanation for the required shares along with how to easily handle the share
- Changed the header Playbooks to Sample Playbooks so user's would have a better idea of what was there

dellemc_configure_idrac_eventing.py
dellemc_configure_idrac_services.py
dellemc_idrac_lc_attributes.py
dellemc_system_lockdown_mode.py
idrac_bios.py
idrac_firmware.py
idrac_network.py
idrac_syslog.pyidrac_timezone_ntp.py:
- Added error handling such that if a share is used and not valid the module gracefully fails.
- Fixes dell#266
- Fixes dell#194
- Fixes dell#160

All files:
- optimized imports

Signed-off-by: Grant Curell <grant_curell@dell.com>
grantcurell added a commit to grantcurell/dellemc-openmanage-ansible-modules that referenced this issue Jun 16, 2021
dellemc_configure_idrac_eventing.py
dellemc_configure_idrac_services.py
dellemc_idrac_lc_attributes.py
dellemc_system_lockdown_mode.py
idrac_bios.py
idrac_firmware.py
idrac_network.py
idrac_syslog.pyidrac_timezone_ntp.py:

Added error handling such that if a share is used and not valid the module gracefully fails.

- Fixes dell#266
- Fixes dell#160

Signed-off-by: Grant Curell <grant_curell@dell.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant