summaryrefslogtreecommitdiffstats
path: root/api/escalator/common/utils.py
diff options
context:
space:
mode:
authorkong wei <kong.wei2@zte.com.cn>2016-12-21 00:46:58 +0000
committerkong wei <kong.wei2@zte.com.cn>2016-12-21 07:24:17 +0000
commitbb4fad27927c6fba2c6231d136661da050f6f5c6 (patch)
tree20c78d8dd627f9cb5cedf9372c59ad321c0cb062 /api/escalator/common/utils.py
parent6963d16b32f0c40ea45be66bbd189d2d5bb070fb (diff)
There are some flake8 errors. Clear them before other work.
Change-Id: Ied9ce8cd0d3c3537c34713ea26cc596914caca85 Signed-off-by: kongwei <kong.wei2@zte.com.cn>
Diffstat (limited to 'api/escalator/common/utils.py')
-rw-r--r--api/escalator/common/utils.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/api/escalator/common/utils.py b/api/escalator/common/utils.py
index ccdc7f8..6cb1784 100644
--- a/api/escalator/common/utils.py
+++ b/api/escalator/common/utils.py
@@ -43,15 +43,10 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import encodeutils
from oslo_utils import excutils
-from oslo_utils import netutils
-from oslo_utils import strutils
import six
from webob import exc
-import ConfigParser
-
from escalator.common import exception
from escalator import i18n
-# from providerclient.v1 import client as provider_client
CONF = cfg.CONF
@@ -666,9 +661,11 @@ def ip_into_int(ip):
def int_into_ip(num):
- inter_ip = lambda x: '.'.join(
- [str(x / (256 ** i) % 256) for i in range(3, -1, -1)])
- return inter_ip(num)
+ s = []
+ for i in range(4):
+ s.append(str(num % 256))
+ num /= 256
+ return '.'.join(s[::-1])
def is_ip_in_cidr(ip, cidr):
@@ -939,6 +936,3 @@ def translate_marks_4_sed_command(ori_str):
translated_str = translated_str.\
replace(translated_mark, translated_marks[translated_mark])
return translated_str
-
-
-