blob: 940ebb0ec12b9a685bef1427971f1505e17e1b37 (
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
|
# -*- coding: utf-8 -*-
# Copyright 2004-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
class EnvironmentUndefinedError(Exception):
"""The environment variable is undefined."""
class InvalidConfigError(Exception):
"""The configuration file is invalid."""
def __init__(self, file):
self.file = file
class InvalidVMError(Exception):
"""The 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 available for %s
Please check your your environment""" % (self._virtual)
class PermissionError(Exception):
"""File permissions are wrong or you are not a privileged user."""
class UnexistingPackageError(Exception):
"""Package 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:
|