src/flow/lib/LifeCycleManager.rb
def deploy_roles(client, roles, success_state, error_state, scale, report)
        # rubocop:enable Metrics/ParameterLists
        if scale
            action = :wait_scaleup
        else
            action = :wait_deploy
        end

        roles.each do |name, role|
            rc = role.deploy

            if !rc[0]
                role.set_state(Role::STATE[error_state])
                break OpenNebula::Error.new(
                    "Error deploying role #{name}: #{rc[1]}"
                )
            end

            role.set_state(Role::STATE[success_state])

            @event_manager.trigger_action(action,
                                          role.service.id,
                                          client,
                                          role.service.id,
                                          role.name,
                                          rc[0],
                                          report)
        end
    end
# Returns true if the deployments of all roles was fine and
# update their state consequently
# @param [Array<Role>] roles to be deployed
# @param [Role::STATE] success_state new state of the role
#                      if deployed successfuly
# @param [Role::STATE] error_state new state of the role
#                      if deployed unsuccessfuly
# rubocop:disable Metrics/ParameterLists
Returns true if the deployments of all roles was fine and
update their state consequently
Returns true if the deployments of all roles was fine and update their state consequently
def deploy_roles(client, roles, success_state, error_state, scale, report)
        if scale
            action = :wait_scaleup
        else
            action = :wait_deploy
        end
        roles.each do |name, role|
            rc = role.deploy
            if !rc[0]
                role.set_state(Role::STATE[error_state])
                break OpenNebula::Error.new(
                    "Error deploying role #{name}: #{rc[1]}"
                )
            end
            role.set_state(Role::STATE[success_state])
            @event_manager.trigger_action(action,
                                          role.service.id,
                                          client,
                                          role.service.id,
                                          role.name,
                                          rc[0],
                                          report)
        end
    end
def deploy_roles ( client , roles , success_state , error_state , scale , report ) if scale action = :wait_scaleup else action = :wait_deploy end roles . each do | name , role | rc = role . deploy if ! rc [ 0 ] role . set_state ( Role :: STATE [ error_state ] ) break OpenNebula :: Error . new ( "Error deploying role #{name}: #{rc[1]}" ) end role . set_state ( Role :: STATE [ success_state ] ) @event_manager . trigger_action ( action , role . service . id , client , role . service . id , role . name , rc [ 0 ] , report ) end end
Returns true if the deployments of all roles was fine and
update their state consequently
Returns true if the deployments of all roles was fine and update their state consequently
# rubocop:enable Metrics/ParameterLists
client
roles
success_state
error_state
scale
report
error_state new state of the role if deployed unsuccessfuly rubocop:disable Metrics/ParameterLists
error_state new state of the role if deployed unsuccessfuly rubocop : disable Metrics / ParameterLists