示例#1
0
 def test_fail_with_vdsm_exception(self):
     exc = exception.NoSuchVM()
     res = self.vm.fail(exc)
     expected = exception.NoSuchVM().response()
     self.assertEqual(res, expected)
示例#2
0
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# Refer to the README and COPYING files for full details of the license
#

from __future__ import absolute_import
from __future__ import division
from vdsm.common import exception

# TODO: Drop after callers changed to raise the exceptions
errCode = {
    'noVM': exception.NoSuchVM().response(),
    'nfsErr': exception.AccessTimeout().response(),
    'exist': exception.VMExists().response(),
    'noVmType': exception.UnsupportedVMType().response(),
    'down': exception.VMIsDown().response(),
    'copyerr': exception.CopyFailed().response(),
    'sparse': exception.CannotCreateSparse().response(),
    'createErr': exception.CannotCreateVM().response(),
    'noConPeer': exception.NoConnectionToPeer().response(),
    'MissParam': exception.MissingParameter().response(),
    'migrateErr': exception.MigrationError().response(),
    'imageErr': exception.ImageFileNotFound().response(),
    'outOfMem': exception.OutOfMemory().response(),
    'unexpected': exception.UnexpectedError().response(),
    'unsupFormat': exception.UnsupportedImageFormat().response(),
    'ticketErr': exception.SpiceTicketError().response(),