def present(name,
            protocol=None,
            service_address=None,
            scheduler='wlc',
           ):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    #check service
    service_check = __salt__['lvs.check_service'](protocol=protocol,
                                                  service_address=service_address)
    if service_check is True:
        service_rule_check = __salt__['lvs.check_service'](protocol=protocol,
                                                           service_address=service_address,
                                                           scheduler=scheduler)
        if service_rule_check is True:
            ret['comment'] = 'LVS Service {0} is present'.format(name)
            return ret
        else:
            if __opts__['test']:
                ret['result'] = None
                ret['comment'] = 'LVS Service {0} is present but some options should update'.format(name)
                return ret
            else:
                service_edit = __salt__['lvs.edit_service'](protocol=protocol,
                                                            service_address=service_address,
                                                            scheduler=scheduler)
                if service_edit is True:
                    ret['comment'] = 'LVS Service {0} has been updated'.format(name)
                    ret['changes'][name] = 'Update'
                    return ret
                else:
                    ret['result'] = False
                    ret['comment'] = 'LVS Service {0} update failed'.format(name)
                    return ret
    else:
        if __opts__['test']:
            ret['comment'] = 'LVS Service {0} is not present and needs to be created'.format(name)
            ret['result'] = None
            return ret
        else:
            service_add = __salt__['lvs.add_service'](protocol=protocol,
                                                      service_address=service_address,
                                                      scheduler=scheduler)
            if service_add is True:
                ret['comment'] = 'LVS Service {0} has been created'.format(name)
                ret['changes'][name] = 'Present'
                return ret
            else:
                ret['comment'] = 'LVS Service {0} create failed({1})'.format(name, service_add)
                ret['result'] = False
                return ret
Given a dict of attributes from the <embed> tag, return the real HTML
dataset/ETHPy150Open saltstack/salt/salt/states/lvs_service.py/present--crossover with--dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailembeds/rich_text.py/MediaEmbedHandler.expand_db_attributes