(apiclient, hostid, resourcestate)
| 3364 | |
| 3365 | @staticmethod |
| 3366 | def _check_resource_state(apiclient, hostid, resourcestate): |
| 3367 | hosts = Host.list(apiclient, id=hostid, listall=True) |
| 3368 | |
| 3369 | validationresult = validateList(hosts) |
| 3370 | |
| 3371 | assert validationresult is not None, "'validationresult' should not be equal to 'None'." |
| 3372 | |
| 3373 | assert isinstance(validationresult, list), "'validationresult' should be a 'list'." |
| 3374 | |
| 3375 | assert len(validationresult) == 3, "'validationresult' should be a list with three items in it." |
| 3376 | |
| 3377 | if validationresult[0] == FAIL: |
| 3378 | raise Exception("Host list validation failed: %s" % validationresult[2]) |
| 3379 | |
| 3380 | if str(hosts[0].resourcestate).lower() == str(resourcestate).lower(): |
| 3381 | return True, None |
| 3382 | |
| 3383 | return False, "Host is not in the following state: " + str(resourcestate) |
| 3384 | |
| 3385 | def delete(self, apiclient): |
| 3386 | """Delete Host""" |
nothing calls this directly
no test coverage detected