request is not guaranteed to have a value and so if the request fails, the code is trying to get the 'status_code' attribute of None which will result in an AttributeError exception being raised.
Example:
AttributeError: 'NoneType' object has no attribute 'status_code'
This line of code is causing an attibute error.
https://github.com/dwighthubbard/python-dlipower/blob/6d6c961a3da1059c42ff4abc0114b266edaf1028/dlipower/dlipower.py#L429
request is not guaranteed to have a value and so if the request fails, the code is trying to get the 'status_code' attribute of None which will result in an AttributeError exception being raised.
Example: