def _get_instance_state(self):
        """
        Attempt to retrieve the state of the instance.
         Raises:
            EC2CloudException: If the instance cannot be found.
        """
        instance = self._get_instance()
        state = None

        try:
            state = instance.state['Name']
        except Exception:
            raise EC2CloudException(
                'Instance with id: {instance_id}, '
                'cannot be found.'.format(
                    instance_id=self.running_instance_id
                )
            )

        return state
def _get_instance_state ( self ) : instance = self . _get_instance ( ) state = None try : state = instance . state [ 'Name' ] except Exception : raise EC2CloudException ( 'Instance with id: {instance_id}, ' 'cannot be found.' . format ( instance_id = self . running_instance_id ) ) return state
Attempt to retrieve the state of the instance.
         Raises:
            EC2CloudException: If the instance cannot be found.