summaryrefslogtreecommitdiff
path: root/dracclient/resources/lifecycle_controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'dracclient/resources/lifecycle_controller.py')
-rw-r--r--dracclient/resources/lifecycle_controller.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/dracclient/resources/lifecycle_controller.py b/dracclient/resources/lifecycle_controller.py
index d0a1c54..35c86b9 100644
--- a/dracclient/resources/lifecycle_controller.py
+++ b/dracclient/resources/lifecycle_controller.py
@@ -15,6 +15,8 @@ from dracclient.resources import uris
15from dracclient import utils 15from dracclient import utils
16from dracclient import wsman 16from dracclient import wsman
17 17
18IDRAC_IS_READY = "LC061"
19
18 20
19class LifecycleControllerManagement(object): 21class LifecycleControllerManagement(object):
20 22
@@ -85,6 +87,37 @@ class LCConfiguration(object):
85 87
86 return result 88 return result
87 89
90 def is_idrac_ready(self):
91 """Indicates if the iDRAC is ready to accept commands
92
93 Returns a boolean indicating if the iDRAC is ready to accept
94 commands.
95
96 :returns: Boolean indicating iDRAC readiness
97 :raises: WSManRequestFailure on request failures
98 :raises: WSManInvalidResponse when receiving invalid response
99 :raises: DRACOperationFailed on error reported back by the DRAC
100 interface
101 :raises: DRACUnexpectedReturnValue on return value mismatch
102 """
103
104 selectors = {'SystemCreationClassName': 'DCIM_ComputerSystem',
105 'SystemName': 'DCIM:ComputerSystem',
106 'CreationClassName': 'DCIM_LCService',
107 'Name': 'DCIM:LCService'}
108
109 result = self.client.invoke(uris.DCIM_LCService,
110 'GetRemoteServicesAPIStatus',
111 selectors,
112 {},
113 expected_return_value=utils.RET_SUCCESS)
114
115 message_id = utils.find_xml(result,
116 'MessageID',
117 uris.DCIM_LCService).text
118
119 return message_id == IDRAC_IS_READY
120
88 121
89class LCAttribute(object): 122class LCAttribute(object):
90 """Generic LC attribute class""" 123 """Generic LC attribute class"""