In an unpublished case, Durack v. Wang, B276086,  on September 27, 2017 the Court stated that Civil Code 1717 does NOT apply in an action based upon CC&R’s so attorney’s fees can be awarded against a party who voluntarily dismissed an action!  In this case Plaintiffs  brought an action against their condominium homeowners association and several individual defendants and settled as to all defendants but one, then voluntarily dismissed their action against the hold-out defendant.  Civil Code 1717 only applies to an action on a contract, where the contract specifically provides that attorneys fees and costs, which are incurred to enforce the contract, shall be awarded…. Because there is no attorneys fees provision in the CC&Rs (or in any other relevant document), section 1717 is inapplicable.  The controlling statute, per Justice John Segal  was Civil Code §5975(c), relating to homeowners associations, which declares:

In an action to enforce the governing documents, the prevailing party shall be awarded reasonable attorneys fees and costs. and no exception is set forth in that statute where there is a voluntary dismissal.