'Prepare FC Consistency Group.'

def prepare_fc_consistgrp(self, fc_consistgrp, timeout):

    self.ssh.prestartfcconsistgrp(fc_consistgrp)
    def prepare_fc_consistgrp_success():
        mapping_ready = False
        mapping_attrs = self._get_flashcopy_consistgrp_attr(fc_consistgrp)
        if ((mapping_attrs is None) or ('status' not in mapping_attrs)):
            pass
        if (mapping_attrs['status'] == 'prepared'):
            mapping_ready = True
        elif (mapping_attrs['status'] == 'stopped'):
            self.ssh.prestartfcconsistgrp(fc_consistgrp)
        elif (mapping_attrs['status'] != 'preparing'):
            msg = (_('Unexpected    mapping    status    %(status)s    for    mapping%(id)s.    Attributes:    %(attr)s.') % {'status': mapping_attrs['status'], 'id': fc_consistgrp, 'attr': mapping_attrs})
            LOG.error(msg)
            raise exception.VolumeBackendAPIException(data=msg)
        return mapping_ready
    self._wait_for_a_condition(prepare_fc_consistgrp_success, timeout)
