blob: a6ec494af11c04d5be5452756978388c8f182aa2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# -*- coding: UTF-8 -*-
# Copyright 2004-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
class EnvironmentUndefinedError(Exception):
"""
Environment Variable is undefined!
"""
class InvalidConfigError(Exception):
"""
Invalid Configuration File
"""
def __init__(self, file):
self.file = file
class InvalidVMError(Exception):
"""
Specified Virtual Machine does not exist or is invalid
"""
class ProviderUnavailableError(Exception):
"""
No provider is available for the specified Virtual.
"""
def __init__( self, virtual, vms, packages ):
self._virtual = virtual
self._vms = vms
self._packages = packages
def packages(self):
return self._packages
def virtual(self):
return self._virtual
def vms(self):
return self._vms
def __str__(self):
return """No provider is available for """ + self._virtual + """
Please check your environment."""
class PermissionError(Exception):
"""
The permission on the file are wrong or you are not a privileged user
"""
class UnexistingPackageError(Exception):
"""
Thrown when a function is called to do something on a package that does not exist
"""
def __init__(self, package):
self.package = package
def __str__(self):
return "Package %s was not found!" % self.package
# vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
|