Revision b660fcda

b/ncclient/manager.py
35 35
#: Same as :meth:`connect_ssh`
36 36
connect = connect_ssh
37 37

  
38
OPERATIONS = {
39
    "get": operations.Get,
40
    "get_config": operations.GetConfig,
41
    "edit_config": operations.EditConfig,
42
    "copy_config": operations.CopyConfig,
43
    "validate": operations.Validate,
44
    "commit": operations.Commit,
45
    "discard_changes": operations.DiscardChanges,
46
    "delete_config": operations.DeleteConfig,
47
    "lock": operations.Lock,
48
    "unlock": operations.Unlock,
49
    "close_session": operations.CloseSession,
50
    "kill_session": operations.KillSession,
51
    "poweroff_machine": operations.PoweroffMachine,
52
    "reboot_machine": operations.RebootMachine
53
}
54

  
38 55
class Manager(object):
39 56

  
40 57
    """API for NETCONF operations.
......
56 73
        return False
57 74

  
58 75
    def __getattr__(self, name):
59
        op = operations.INDEX.get(name, None)
76
        op = OPERATIONS.get(name, None)
60 77
        if op is None:
61 78
            raise AttributeError
62 79
        else:
b/ncclient/operations/__init__.py
23 23
# others...
24 24
from flowmon import PoweroffMachine, RebootMachine
25 25

  
26
INDEX = {
27
    'get': Get,
28
    'get_config': GetConfig,
29
    'edit_config': EditConfig,
30
    'copy_config': CopyConfig,
31
    'validate': Validate,
32
    'commit': Commit,
33
    'discard_changes': DiscardChanges,
34
    'delete_config': DeleteConfig,
35
    'lock': Lock,
36
    'unlock': Unlock,
37
    'close_session': CloseSession,
38
    'kill_session': KillSession,
39
    'poweroff_machine': PoweroffMachine,
40
    'reboot_machine': RebootMachine
41
}
42

  
43 26
__all__ = [
44 27
    'RPC',
45 28
    'RPCReply',
46 29
    'RPCError',
47
    'OPERATIONS',
48 30
    'Get',
49 31
    'GetConfig',
50 32
    'GetReply',

Also available in: Unified diff