cc1
v2.1
CC1 source code docs
Main Page
Related Pages
Packages
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Pages
request.py
Go to the documentation of this file.
1
# _*_ coding: utf_8 _*_
2
# @COPYRIGHT_begin
3
#
4
# Copyright [2010_2013] Institute of Nuclear Physics PAN, Krakow, Poland
5
#
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
9
#
10
# http://www.apache.org/licenses/LICENSE_2.0
11
#
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS,
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
# See the License for the specific language governing permissions and
16
# limitations under the License.
17
#
18
# @COPYRIGHT_end
19
##
20
# @package src.cm.views.ec2ctx.helpers.request
21
#
22
# @copyright Copyright (c) 2013 Institute of Nuclear Physics PAS <http://www.ifj.edu.pl/>
23
# @author Łukasz Chrząszcz <l.chrzaszcz@gmail.com>
24
#
25
26
from
cm.models.vm
import
VM
27
from
cm.utils
import
log
28
from
cm.utils.exception
import
CMException
29
from
time
import
sleep
30
31
32
def
get_vm_by_ip
(vm_ip):
33
# vm = None
34
# counter = 0
35
# while (not vm and counter < 10):
36
# try:
37
# counter += 1
38
# vm = VM.get_by_ip(vm_ip)
39
# except CMException,error:
40
# log.error(0, "Couldn't get vm by it's ip: %s: %s. Retrying" % (vm_ip, error.message))
41
# sleep(2)
42
# vm = None
43
# if not vm:
44
# log.error(0, "Couldn't get vm by it's ip: %s: %s" % (vm_ip, error.message))
45
# raise cherrypy.HTTPError(500)
46
#
47
# return vm
48
pass
49
50
cm
views
ec2ctx
helpers
request.py
Generated on Wed Jun 18 2014 13:33:05 for cc1 by
1.8.1.2