Revision 2abf9522 ncclient/operations/edit.py

b/ncclient/operations/edit.py
58 58
        spec = deepcopy(EditConfig.SPEC)
59 59
        subtree = spec['subtree']
60 60
        subtree.append(util.store_or_url('target', target, self._assert))
61
        if default_operation is not None:
61
        if error_option is not None:
62
            if error_option == 'rollback-on-error':
63
                self._assert(':rollback-on-error')
62 64
            subtree.append({
63
                'tag': 'default-operation',
64
                'text': default_operation
65
                'tag': 'error-option',
66
                'text': error_option
65 67
                })
66 68
        if test_option is not None:
67 69
            self._assert(':validate')
......
69 71
                'tag': 'test-option',
70 72
                'text': test_option
71 73
                })
72
        if error_option is not None:
73
            if error_option == 'rollback-on-error':
74
                self._assert(':rollback-on-error')
74
        if default_operation is not None:
75 75
            subtree.append({
76
                'tag': 'error-option',
77
                'text': error_option
76
                'tag': 'default-operation',
77
                'text': default_operation
78 78
                })
79 79
        subtree.append(content.validated_element(config, ('config', content.qualify('config'))))
80 80
        return self._request(spec)

Also available in: Unified diff