'Checks whether system is registered and has good status.'

def _check_storage_system(self):

    try:
        self._client.list_storage_system()
    except exception.NetAppDriverException:
        with excutils.save_and_reraise_exception():
            LOG.info('System    with    controller    addresses    [%s]    is    not    registered    with    web    service.', self.configuration.netapp_controller_ips)
    new_pwd = self.configuration.netapp_sa_password
    self._client.update_stored_system_password(new_pwd)
    start_time = int(time.time())
    def check_system_status():
        system = self._client.list_storage_system()
        (pass_status, pass_status_valid) = self._check_password_status(system)
        (status, status_valid) = self._check_storage_system_status(system)
        msg_dict = {'id': system.get('id'), 'status': status, 'pass_status': pass_status}
        if (not (pass_status_valid and status_valid)):
            if (not pass_status_valid):
                LOG.info('Waiting    for    web    service    to    validate    the    configured    password.')
            else:
                LOG.info('Waiting    for    web    service    array    communication.')
            if (int((time.time() - start_time)) >= self.SA_COMM_TIMEOUT):
                if (not status_valid):
                    raise exception.NetAppDriverException((_('System    %(id)s    found    with    bad    status    -    %(status)s.') % msg_dict))
                else:
                    raise exception.NetAppDriverException((_('System    %(id)s    found    with    bad    password    status    -    %(pass_status)s.') % msg_dict))
        else:
            LOG.info('System    %(id)s    has    %(status)s    status.', msg_dict)
            raise loopingcall.LoopingCallDone()
    checker = loopingcall.FixedIntervalLoopingCall(f=check_system_status)
    checker.start(interval=self.SLEEP_SECS, initial_delay=self.SLEEP_SECS).wait()
    return True
