Scalr\Api\Service\User\V1beta0\Adapter\OrchestrationRuleAdapter::checkScriptOs PHP Method

checkScriptOs() public method

Checks compliance OS of the script and the role
public checkScriptOs ( Scalr\Model\Entity\OrchestrationRule $entity, string $os )
$entity Scalr\Model\Entity\OrchestrationRule Orchestration Rule entity
$os string OS type
    public function checkScriptOs(OrchestrationRule $entity, $os)
    {
        if (!empty($entity->scriptId)) {
            if (Script::findPk($entity->scriptId)->os == 'windows' && $os != 'windows') {
                throw new ApiErrorException(409, ErrorMessage::ERR_OS_MISMATCH, "Script OS family does not match role OS family");
            }
        }
    }