def op_version(name, version):
    '''
    .. versionadded:: 2019.2.0

    Add brick(s) to an existing volume

    name
        Volume name

    version
        Version to which the cluster.op-version should be set

    .. code-block:: yaml

        myvolume:
          glusterfs.op_version:
            - name: volume1
            - version: 30707
    '''
    ret = {'name': name,
           'changes': {},
           'comment': '',
           'result': False}

    try:
        current = int(__salt__['glusterfs.get_op_version'](name))
    except TypeError:
        ret['result'] = False
        ret['comment'] = __salt__['glusterfs.get_op_version'](name)[1]
        return ret

    if current == version:
        ret['comment'] = 'Glusterfs cluster.op-version for {0} already set to {1}'.format(name, version)
        ret['result'] = True
        return ret
    elif __opts__['test']:
        ret['comment'] = 'An attempt would be made to set the cluster.op-version for {0} to {1}.'.format(name, version)
        ret['result'] = None
        return ret

    result = __salt__['glusterfs.set_op_version'](version)

    if result[0] is False:
        ret['comment'] = result[1]
        return ret

    ret['comment'] = result
    ret['changes'] = {'old': current, 'new': version}
    ret['result'] = True
    return ret
def op_version ( name , version ) : ret = { 'name' : name , 'changes' : { } , 'comment' : '' , 'result' : False } try : current = int ( __salt__ [ 'glusterfs.get_op_version' ] ( name ) ) except TypeError : ret [ 'result' ] = False ret [ 'comment' ] = __salt__ [ 'glusterfs.get_op_version' ] ( name ) [ 1 ] return ret if current == version : ret [ 'comment' ] = 'Glusterfs cluster.op-version for {0} already set to {1}' . format ( name , version ) ret [ 'result' ] = True return ret elif __opts__ [ 'test' ] : ret [ 'comment' ] = 'An attempt would be made to set the cluster.op-version for {0} to {1}.' . format ( name , version ) ret [ 'result' ] = None return ret result = __salt__ [ 'glusterfs.set_op_version' ] ( version ) if result [ 0 ] is False : ret [ 'comment' ] = result [ 1 ] return ret ret [ 'comment' ] = result ret [ 'changes' ] = { 'old' : current , 'new' : version } ret [ 'result' ] = True return ret
.. versionadded:: 2019.2.0

    Add brick(s) to an existing volume

    name
        Volume name

    version
        Version to which the cluster.op-version should be set

    .. code-block:: yaml

        myvolume:
          glusterfs.op_version:
            - name: volume1
            - version: 30707