Statistics
| Branch: | Tag: | Revision:

root / lib / rpc / errors.py @ 31d3b918

History | View | Annotate | Download (1.8 kB)

1
#
2
#
3

    
4
# Copyright (C) 2013 Google Inc.
5
#
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
# General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
# 02110-1301, USA.
20

    
21

    
22
"""Module that defines a transport for RPC connections.
23

24
A transport can send to and receive messages from some endpoint.
25

26
"""
27

    
28
from ganeti.errors import LuxiError
29

    
30

    
31
class ProtocolError(LuxiError):
32
  """Denotes an error in the LUXI protocol."""
33

    
34

    
35
class ConnectionClosedError(ProtocolError):
36
  """Connection closed error."""
37

    
38

    
39
class TimeoutError(ProtocolError):
40
  """Operation timeout error."""
41

    
42

    
43
class RequestError(ProtocolError):
44
  """Error on request.
45

46
  This signifies an error in the request format or request handling,
47
  but not (e.g.) an error in starting up an instance.
48

49
  Some common conditions that can trigger this exception:
50
    - job submission failed because the job data was wrong
51
    - query failed because required fields were missing
52

53
  """
54

    
55

    
56
class NoMasterError(ProtocolError):
57
  """The master cannot be reached.
58

59
  This means that the master daemon is not running or the socket has
60
  been removed.
61

62
  """
63

    
64

    
65
class PermissionError(ProtocolError):
66
  """Permission denied while connecting to the master socket.
67

68
  This means the user doesn't have the proper rights.
69

70
  """